Guest User

Untitled

a guest
Nov 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. datetime.datetime.now(tz=pytz.utc).strftime("%y-%b-%d-%H-%M-%S")
  2.  
  3. 17-Nov-25-01-37-20
  4.  
  5. >>> datetime.datetime.now(tz=pytz.US/Pacific).strftime("%y-%b-%d-%H-%M-%S")
  6.  
  7. Traceback (most recent call last):
  8. File "<stdin>", line 1, in <module>
  9. AttributeError: module 'pytz' has no attribute 'US'
  10.  
  11. >>> datetime.datetime.now(tz=pytz.America/Pacific).strftime("%y-%b-%d-%H-%M-%S")
  12.  
  13. Traceback (most recent call last):
  14. File "<stdin>", line 1, in <module>
  15. AttributeError: module 'pytz' has no attribute 'America'
  16.  
  17. >>> datetime.datetime.now(tz=pytz.US/Pacific).strftime("%y-%b-%d-%H-%M-%S")
  18. Traceback (most recent call last):
  19. File "<stdin>", line 1, in <module>
  20. AttributeError: module 'pytz' has no attribute 'US'
  21.  
  22. >>> datetime.datetime.now(tz=pytz.US).strftime("%y-%b-%d-%H-%M-%S")
  23. Traceback (most recent call last):
  24. File "<stdin>", line 1, in <module>
  25. AttributeError: module 'pytz' has no attribute 'US'
  26.  
  27. >>> datetime.datetime.now(tz=pytz.Pacific).strftime("%y-%b-%d-%H-%M-%S")
  28. Traceback (most recent call last):
  29. File "<stdin>", line 1, in <module>
  30. AttributeError: module 'pytz' has no attribute 'Pacific'
  31.  
  32. >>> datetime.datetime.now(tz=pytz.timezone("US/Pacific").strftime("%y-%b-%d-%H-%M-%S")
  33. ...
  34.  
  35. KeyboardInterrupt . #this never returns anything. just kill it manually
Add Comment
Please, Sign In to add comment