ForumsDevelopersHow to decode the value of date files in the Backup XML


How to decode the value of date files in the Backup XML
Author Message
charles.cave

Posted: Apr 23, 2013
Score: 0 Reference
Hello,

I would like to parse the Backup XML to produce some special reports, but I don't know how the dates can be decoded.

For example:
<export_date>1366696711</export_date>
<duedate>1366632000</duedate>

How can I convert this number into YY, MM, DD and possibly HH and MM if I have enabled using times?

Thanks,
Charles
Jake

Toodledo Founder
Posted: Apr 23, 2013
Score: 0 Reference
The numbers are unix time stamps.

http://en.wikipedia.org/wiki/Unix_time
charles.cave

Posted: Apr 24, 2013
Score: 0 Reference
Thanks! I should be able to easily convert using the Python
datetime module:

import datetime
print(datetime.datetime.fromtimestamp(int("1284101485")).strftime('%Y-%m-%d %H:%M:%S'))
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.