I have a particular date and time. Now, I want to convert the time according to device current time zone. Basically what I need is an script that, when provided with a time and a timezone can return the time in another time zone. How can I achieve it ?
Asked
Active
Viewed 361 times
2
-
According to the docs https://sdkdocs.roku.com/display/sdkdoc/ifDateTime, it looks like there's a utility function to find the offset from UTC. Check out GetTimeZoneOffset(). – panzhuli Jul 27 '17 at 18:18
1 Answers
0
According to Roku docs https://developer.roku.com/en-gb/docs/references/brightscript/interfaces/ifdatetime.md the roDateTime object uses ifDateTime interface which has a method called toLocalTime().
You can use it to get the local time of the device, this is easier than calculating the time zone offset.
datetime = createobject("roDateTime")
datetime.toLocalTime()

Verònica Jandrew
- 452
- 3
- 13