Home  >  Support  >  Support Forum  >  How can I obtain timestamps in useful format when exporting data from device cloud?
Notice! We've recently migrated to using a new forum, we hope you enjoy it. If you are an existing member and this is your first time visiting our new forum, please reset your password to be able to sign in.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How can I obtain timestamps in useful format when exporting data from device cloud?

0 votes
When data streams are exported from device cloud, the timestamp format is not in a useful format. Can anything be done to convert this or to export data in a manner that translates timestamp correctly?
asked Apr 4 in Data Services by ctaylor New to the Community (5 points)

Please log in or register to answer this question.

2 Answers

0 votes
The timestamp is in EPOCH format, that means it's a "long" integer of the amount of miliseconds that have passed since January 1st, 1970.
There are differente libraries for parsing EPOCH timestamp into other formats. It depends on the programming language.
answered Jul 14 by abregofj New to the Community (2 points)
0 votes
here is something in python close to what you want.:
# takes the number of seconds since 1900 jan 1st 00:00:00 and returns it
# as a string representation in the form "Sat Jun 27 13:13:41 2009"
def parseNTPResponse(data):
TIME1970 = 2208988800L
t = struct.unpack( '!12I', data )[10]
t -= TIME1970
timeString = '%s' % time.ctime(t)
print "timeString = ", timeString
return timeString
answered Sep 6 by kjensen8 Veteran of the Digi Community (469 points)
Contact a Digi expert and get started today! CONTACT US