Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- datetime.datetime.now(tz=pytz.utc).strftime("%y-%b-%d-%H-%M-%S")
- 17-Nov-25-01-37-20
- >>> datetime.datetime.now(tz=pytz.US/Pacific).strftime("%y-%b-%d-%H-%M-%S")
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: module 'pytz' has no attribute 'US'
- >>> datetime.datetime.now(tz=pytz.America/Pacific).strftime("%y-%b-%d-%H-%M-%S")
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: module 'pytz' has no attribute 'America'
- >>> datetime.datetime.now(tz=pytz.US/Pacific).strftime("%y-%b-%d-%H-%M-%S")
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: module 'pytz' has no attribute 'US'
- >>> datetime.datetime.now(tz=pytz.US).strftime("%y-%b-%d-%H-%M-%S")
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: module 'pytz' has no attribute 'US'
- >>> datetime.datetime.now(tz=pytz.Pacific).strftime("%y-%b-%d-%H-%M-%S")
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: module 'pytz' has no attribute 'Pacific'
- >>> datetime.datetime.now(tz=pytz.timezone("US/Pacific").strftime("%y-%b-%d-%H-%M-%S")
- ...
- KeyboardInterrupt . #this never returns anything. just kill it manually
Add Comment
Please, Sign In to add comment