Add new timestamp_to_datetime helper function.

(imported from commit 6791d009ae2e8371abe2c929e87c816a1981f5fe)
This commit is contained in:
Tim Abbott
2012-12-05 13:53:23 -05:00
parent f843152427
commit 970969fc44
4 changed files with 13 additions and 7 deletions

5
zephyr/lib/time.py Normal file
View File

@@ -0,0 +1,5 @@
import datetime
from django.utils.timezone import utc
def timestamp_to_datetime(timestamp):
return datetime.datetime.utcfromtimestamp(float(timestamp)).replace(tzinfo=utc)