dan19
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2021
09:38 AM
Hello,
I am trying to get the current time of a certain place (not my roku device time), based on the given timezone.
For example, if I have a timezone of -25200, how do I get the roDateTime of this location?
I have seen JS methods for doing this, and I was wondering if it doable in BRS.
Thanks.
1 Solution
Accepted Solutions
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2021
11:53 PM
For the current time:
t = CreateObject("roDateTime") t.fromSeconds(t.asSeconds()-25200)
For some other time replace t.asSeconds() with the GMT time in seconds (from epoch - 1/1/1970) you want to convert to another timezone.
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
1 REPLY 1
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2021
11:53 PM
For the current time:
t = CreateObject("roDateTime") t.fromSeconds(t.asSeconds()-25200)
For some other time replace t.asSeconds() with the GMT time in seconds (from epoch - 1/1/1970) you want to convert to another timezone.
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.