Add a utility for getting the current UTC seconds-since-epoch time.

testing/mmn/mktime_takes_localtime_not_gmtime
Isis Lovecruft 2013-05-27 08:14:08 +00:00
parent 50b057918b
commit a0e1d4db6e
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 4 additions and 0 deletions

View File

@ -377,6 +377,10 @@ def _threaded_copy_data(instream, outstream):
copy_thread.start()
return copy_thread
def _utc_epoch():
"""Get the seconds since epoch for UTC."""
return int(time.mktime(time.gmtime()))
def _which(executable, flags=os.X_OK):
"""Borrowed from Twisted's :mod:twisted.python.proutils .