djangosnippets.org: Latest snippets tagged with 'precision'https://djangosnippets.org/tags/precision/2010-04-27T05:40:41.710824-05:00datetime.time/datetime.datetime to Unix Epoch (with microsecond support)
2010-04-27T05:40:41.710824-05:00sleepycalhttps://djangosnippets.org/snippets/1997/<p>This is useful when you need to convert a datetime.datetime.now() or datetime.date.today() into a unix epoch seconds, with microsecond precision (precision only applies to datetime.datetime, as datetime.date won't have any microseconds).</p>
<p>I have found this is necessary for when storing the DateTime in the models as a FloatField, in order …</p>
Freely redistributable