vbacct
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014
12:25 PM
wrong values for timeZoneOffset
Hello
We are seeing erroneous timeZoneOffSet values being sent from some of the client Roku boxes. These values are outside the range of -720 to +720 (12 hours). The timeZoneOffset is calculated as follows
nowDate = CreateObject("roDateTime")
UTCDateHour = nowDate.getHours()
nowDate.toLocalTime()
localDateHour = nowDate.getHours()
timeZoneOffset = (UTCDateHour - localDateHour) * 60
I've tested the above code on my local Roku box with all different time zone settings and the above function seems to be working correctly. I was wondering if the above issue was because the client has not set the time on their Roku boxes. Does the Roku box automatically set the timezone correctly or should this be done by the client specifically? If the client does not set the time, what is the default value set on the Roku box?
Thanks
We are seeing erroneous timeZoneOffSet values being sent from some of the client Roku boxes. These values are outside the range of -720 to +720 (12 hours). The timeZoneOffset is calculated as follows
nowDate = CreateObject("roDateTime")
UTCDateHour = nowDate.getHours()
nowDate.toLocalTime()
localDateHour = nowDate.getHours()
timeZoneOffset = (UTCDateHour - localDateHour) * 60
I've tested the above code on my local Roku box with all different time zone settings and the above function seems to be working correctly. I was wondering if the above issue was because the client has not set the time on their Roku boxes. Does the Roku box automatically set the timezone correctly or should this be done by the client specifically? If the client does not set the time, what is the default value set on the Roku box?
Thanks
2 REPLIES 2

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014
01:35 PM
Re: wrong values for timeZoneOffset
Hi, the user sets the time zone when they set up the device the first time. Relocating the device to another time zone or choosing the incorrect one during setup might cause it provide inaccurate data. I believe devices default to Eastern Standard Time, at least when configured in North America.
- Joel
- Joel
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014
05:11 PM
Re: wrong values for timeZoneOffset
The reason you are getting time difference outside of [-12, +12] is that toLocalTime() conversion may cross midnight back or forth, i.e. into the next or previous day. So you easily get difference swinging [-23, +23].