Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [20]: from datetime import datetime
- In [21]: from dateutil.tz import tzlocal
- In [22]: now = datetime.now(tzlocal())
- In [23]: timestamp = now.replace(microsecond=0).isoformat()
- In [24]: print timestamp
- -------> print(timestamp)
- 2011-02-01T01:05:00+01:00
- In [25]: now.tzname()
- Out[25]: 'CET'
Add Comment
Please, Sign In to add comment