Guest User

Untitled

a guest
Jul 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. In [20]: from datetime import datetime
  2.  
  3. In [21]: from dateutil.tz import tzlocal
  4.  
  5. In [22]: now = datetime.now(tzlocal())
  6.  
  7. In [23]: timestamp = now.replace(microsecond=0).isoformat()
  8.  
  9. In [24]: print timestamp
  10. -------> print(timestamp)
  11. 2011-02-01T01:05:00+01:00
  12.  
  13. In [25]: now.tzname()
  14. Out[25]: 'CET'
Add Comment
Please, Sign In to add comment