Timestamp Converter


Timestamp

Convert to



A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred. This data is usually presented in a consistent format, allowing for easy comparison of two different records and tracking progress over time;
Source: Wikipedia.org.

Time in Python

Active Directory / LDAP Python Timestamp converter
>>> from datetime import datetime, timedelta
>>> def convert_ad_timestamp(timestamp):
...     epoch_start = datetime(year=1601, month=1,day=1)
...     seconds_since_epoch = timestamp/10**7
...     return epoch_start + timedelta(seconds=seconds_since_epoch)
... 
>>> convert_ad_timestamp(129410017915727600)
datetime.datetime(2011, 2, 1, 2, 43, 11)
>>> convert_ad_timestamp(129410017915727600).strftime("%y-%m-%d %H:%M")
'11-02-01 02:43'