Got this value from LDAP computer logon timestamp:
lastLogon: 133322323232233542
How to convert it to datetime in python ? (it looks like it's string for int64 representation ?)
Thanks,
Got this value from LDAP computer logon timestamp:
lastLogon: 133322323232233542
How to convert it to datetime in python ? (it looks like it's string for int64 representation ?)
Thanks,
It appears to be a Unix timestamp in a string format. In order to convert it to a datetime
object in Python, you can use the datetime
module.
import datetime
timestamp = int("133322323232233542")
datetime_obj = datetime.datetime.fromtimestamp(timestamp / 10000000
- 11644473600)
print(datetime_obj)