Last active
December 20, 2015 07:29
-
-
Save oevans/6093614 to your computer and use it in GitHub Desktop.
Converting ArcGIS Online UNIX time to a standard readable date/time format
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
| # Modify time formatting codes (e.g., "%Y", etc.) as needed using values from table in python docs here: | |
| # http://docs.python.org/2/library/time.html#time.strftime | |
| # Replace <AGO DATE/TIME> with your time value/variable | |
| import time | |
| time.strftime("%Y-%m-%d %I:%M:%S %p (%Z)",time.localtime(<AGO DATE/TIME>/1000)) | |
| # SAMPLE RESULT - '2013-07-31 11:59:33 PM (Eastern Daylight Time)' | |
| ########## | |
| # alternate usage -- selects your locale's appropriate date/time representation | |
| import time | |
| time.strftime("%c (%Z)",time.localtime(<AGO DATE/TIME>/1000)) | |
| # SAMPLE RESULT - '07/31/13 23:59:33 (Eastern Daylight Time)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment