Last active
March 8, 2020 07:27
-
-
Save insaneyilin/1278b40ce45f7fa3c64ee15927b055fa to your computer and use it in GitHub Desktop.
print today's date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import time | |
| import datetime | |
| # change your birthday here | |
| my_birthday = datetime.datetime(2000, 1, 1, 00, 00, 00) | |
| dt_now = datetime.datetime.now() | |
| print(dt_now) | |
| print('UNIX timestamp: {}'.format(dt_now.timestamp())) | |
| print('Week: {} / 52'.format(time.strftime('%W'))) | |
| print('You have lived {} days'.format((dt_now - my_birthday).days)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment