Forum Discussion

aarongough's avatar
aarongough
Visitor
14 years ago

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:

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

  • 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()".