aarongough
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2011
12:01 PM
Timestamp issues
Hey all.
I'm having weird issues with timestamps in Brightscript.
As I understand it you get a timestamp in Brightscript like so:
But when I do this I get values like: 1.311792e+09
Is there any way to get a sane unix timestamp on the Roku?
Thanks.
-A
I'm having weird issues with timestamps in Brightscript.
As I understand it you get a timestamp in Brightscript like so:
dt = createObject("roDateTime")
dt.mark()
print str(dt.asSeconds())
But when I do this I get values like: 1.311792e+09
Is there any way to get a sane unix timestamp on the Roku?
Thanks.
-A
1 REPLY 1

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2011
12:45 PM
Re: Timestamp issues
It's the Str() that's converting the number like that. If you just want to print to the console, then "print dt.AsSeconds()" should work. If you need to convert it to a pretty string for your app to use, you can try "dt.AsSeconds().ToStr()".
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)