diff options
| author | bwarsaw | 2002-05-28 03:07:20 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-05-28 03:07:20 +0000 |
| commit | cac66639ea16d32b7ceddc0ad0690ff1cd58bcb7 (patch) | |
| tree | b485f3966dc7262910785e466c09eb5867701d29 /Mailman/Utils.py | |
| parent | 631fc7e2928c96061021db51a78e3aaba9e6aaf1 (diff) | |
| download | mailman-cac66639ea16d32b7ceddc0ad0690ff1cd58bcb7.tar.gz mailman-cac66639ea16d32b7ceddc0ad0690ff1cd58bcb7.tar.zst mailman-cac66639ea16d32b7ceddc0ad0690ff1cd58bcb7.zip | |
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 3b300c1b8..c7663c326 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -643,6 +643,15 @@ def unique_message_id(mlist): return msgid +# Figure out epoch seconds of midnight at the start of today (or the given +# 3-tuple date of (year, month, day). +def midnight(date=None): + if date is None: + date = time.localtime()[:3] + # -1 for dst flag tells the library to figure it out + return time.mktime(date + (0,)*5 + (-1,)) + + # Utilities to convert from simplified $identifier substitutions to/from # standard Python $(identifier)s substititions. The "Guido rules" for the |
