Last active
July 23, 2016 19:59
-
-
Save CodyKochmann/e3c7be12569b35fcc5a2 to your computer and use it in GitHub Desktop.
timestamp.py
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
| def timestamp(human_readable=False): | |
| # Generates a unix timestamp and a human readable timestamp if passed True | |
| # by: Cody Kochmann | |
| from calendar import timegm | |
| from datetime import datetime | |
| if human_readable: | |
| return(datetime.now()) | |
| else: | |
| return(timegm(datetime.now().utctimetuple())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment