f01522aa7ae4f33e9d74c4007c25cdfed2f011e9
[wolnelektury.git] / apps / api / helpers.py
1 # -*- coding: utf-8 -*-
2
3 from time import mktime
4
5 def timestamp(dtime):
6     "converts a datetime.datetime object to a timestamp with fractional part"
7     return mktime(dtime.timetuple()) + dtime.microsecond / 1000000.0
8