To convert the datetime object to a Unix timestamp using Django:
from django.utils.dateformat import format
timestamp_string = format(datetime.now(), u'U')
Now go forth and be happy!
Mainly notes to self (and for anyone else that may find them useful)
To convert the datetime object to a Unix timestamp using Django:
from django.utils.dateformat import format
timestamp_string = format(datetime.now(), u'U')
Now go forth and be happy!
No comments:
Post a Comment
Leave your thoughts ...
---
If you are having trouble with copy/pasting in comments, you need to sign in or click 'Preview'.
For more information about this Firefox bug, see here.