Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
bcaudill302
Level 7

Unix Timestamp to Readable format

Does anyone know how to convert a unix timestamp "1460400862" to a readable datetime. I have looked through the sdk and could not find anything but I may have just missed something. Thanks in advance for any help.
0 Kudos
5 Replies
TheEndless
Level 7

Re: Unix Timestamp to Readable format

date = CreateObject("roDateTime")
date.FromSeconds(timestamp)
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Highlighted
bcaudill302
Level 7

Re: Unix Timestamp to Readable format

Thanks, that did it. For some reason I didn't think that would work. Oh well, guess I was over complicating it. Thanks again.
0 Kudos
ajitg_4557
Level 7

Re: Unix Timestamp to Readable format

.....
0 Kudos
ajitg_4557
Level 7

Re: Unix Timestamp to Readable format

Please make me understand....where i am doing mistake. Here is my code.

Fill_time=json.FlightInfoExResult.flights[0].filed_time
Fill_time1=Fill_time.ToStr()
Fill_time2=Fill_time1.trim()
now_ok=StrToI(Fill_time2)
date = CreateObject("roDateTime")
EpochToHumanReadableTime=date.FromSeconds(now_ok)
Print"EpochToHumanReadableTime========>>>>>>"EpochToHumanReadableTime

on Telnet i am getting:-
Print"EpochToHumanReadableTime========>>>>>>"<UNINITALIZED>
0 Kudos
renojim
Level 9

Re: Unix Timestamp to Readable format

Add more prints (after every statement if you have to).
0 Kudos