Django: Formate datetime.now() to Unix timestamp

0 comments

To convert the datetime object to a Unix timestamp using Django:

from django.utils.dateformat import format

timestamp_string = format(datetime.now(), u'U')

slidedog
Now go forth and be happy!

Related Posts

0 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.

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog