python module to decode OSX plist integer dates? -


is there python module/snippet can decode integer datestamps contained in osx - mail - plists?

eg, bit:

<key>date-sent</key>     <integer>1264001747</integer> 

is in jan 2010.

how deconstruct? i'm aware of plistlib - gets me integer.

you can use datetime.datetime.fromtimestamp

>>> import datetime >>> datetime.datetime.fromtimestamp(1264001747) datetime.datetime(2010, 1, 20, 10, 35, 47) 

the value 1264001747 timestamp given in seconds epoch. returned datetime object shown in order (year, month, day, hour, minute, second)


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -