Skip to main content

Python 3 timestamp decode/encode tool

Project description

Time Decode

A timestamp and date decoder. Compatible with Python 3.x. (can be compatible with Python 2.7x with minor changes)

I noticed a lack of timestamp conversion utilities in a number of different linux systems. Since I happen to use linux in my day-to-day work I thought this would help.

This was developed with the Digital Forensics field in mind, so all of the testing has been done with the up-to-date SIFT Kit from SANS. If you have any questions, suggestions, helpful thoughts of any kind, please feel free to drop me a line.

Requirements

For python3, dateutil does not come pre-installed as a module. It will need to be installed manually:

sudo apt-get install python3-dateutil or pip install python-dateutil

This python script provides the following conversions from existing timestamps:

  • Unix Seconds
  • Unix Milliseconds
  • Windows 64 bit Hex (in Big Endian)
  • Windows 64 bit Hex (in Little Endian)
  • Google Chrome Time
  • Active Directory/LDAP time
  • Unix Hex 32 bit (in Big Endian)
  • Unix Hex 32 bit (in Little Endian)
  • Cookie Time (Low Value,High Value)
  • Windows OLE 64 bit double (in Big Endian)
  • Windows OLE 64 bit double (in Little Endian)
  • Mac Absolute Time
  • Mac OS/HFS+ Decimal Time
  • HFS/HFS+ Time (in Big Endian)
  • HFS/HFS+ Time (in Little Endian)
  • MS-DOS 32 bit Hex
  • MS-DOS FAT Date + Time
  • Microsoft 128 bit SYSTEMTIME
  • Microsoft FILETIME
  • Mozilla PRTime
  • OLE Automation Date/Time
  • iOS 11 Date/Time
  • Symantec AV timestamp
  • GPS timestamps
  • Google EI URL timestamp (thanks to http://cheeky4n6monkey.blogspot.com/2014/10/google-eid.html)
  • iOS Binary Plist (Mac Absolute + milli/nano seconds)
  • GSM Timestamps

Note that HFS times are in Local Time, where HFS+ times are in UTC. MS-DOS 32 bit Hex values and MS-DOS FAT Date+Time are also in Local Time of the source generating the timestamp. All other times, unless expressly mentioned, are in UTC.

I have added a feature to 'guess' in what format the timestamp is that you've provided. This will run the timestamp you provide against all methods, and provide an output if human-readable. There is also the ability to convert a date-time to all of the aforementioned timestamps. Simply use the following command:

python time_decode.py --timestamp "2017-06-02 13:14:15.678" or for timezones use: python time_decode.py --timestamp "2017-06-02 13:14:15 -5"

The date/time you enter should be in the "YYYY-mm-dd HH:MM:SS.sss" format with the double-quote included, but does not require milli/micro/nano seconds to work. (Double-quote required for Windows Python) If anyone has any other timestamps they think should be added to this tool, please let me know.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

time_decode-2.5.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

time_decode-2.5-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file time_decode-2.5.tar.gz.

File metadata

  • Download URL: time_decode-2.5.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9

File hashes

Hashes for time_decode-2.5.tar.gz
Algorithm Hash digest
SHA256 dc65a2c86f7ee00ed36b569d48863391838065114a33337b1d436583c492288f
MD5 1f6c765f38e1e10fa79492b4776c943f
BLAKE2b-256 16a1c0f02e4a672d5c6ff4a09c01a60f856b64fab03b4f65daeb5af8947b1375

See more details on using hashes here.

File details

Details for the file time_decode-2.5-py3-none-any.whl.

File metadata

  • Download URL: time_decode-2.5-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9

File hashes

Hashes for time_decode-2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7003ac9fd48e51b32b8cd91d546400f03ca6d21e4b059ab9906c9397e82a08b1
MD5 402aa0c044e4bf8be72f7cb6d504c9f6
BLAKE2b-256 7e2fd7cc95322b487059cae74f248861c66c2bbc32534ac268a8db2b02036a75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page