
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2012
11:39 PM
Are date strings localized on non-US Rokus?
I have code in a few channels that uses roDateTime.GetWeekday() to determine the day of the week. Since that method returns a string, I'm concerned that that code will break if the language is set to anything other than English. Testing on my US Roku, GetWeekday() looks to return in English regardless of language setting, but is that true for all Rokus, or only US units? Also, is that likely to change at any point?
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)
4 REPLIES 4

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
09:21 AM
Re: Are date strings localized on non-US Rokus?
This is currently true for all Rokus. We return the US English date strings for GetWeekday() on all Rokus regardless of region or locale.
I would not plan on this always being true. We will at some point modify GetWeekday() to return locale specific strings.
--Kevin
I would not plan on this always being true. We will at some point modify GetWeekday() to return locale specific strings.
--Kevin
MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
09:26 AM
Re: Are date strings localized on non-US Rokus?
Then perhaps you can also include GetWeekDayInteger() to return a numeric indication of the week day?

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
09:31 AM
Re: Are date strings localized on non-US Rokus?
MSGreg,
Yes, you can anticipate a GetWeekDayInteger() method in the future as well.
--Kevin
Yes, you can anticipate a GetWeekDayInteger() method in the future as well.
--Kevin

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
10:05 AM
Re: Are date strings localized on non-US Rokus?
"MSGreg" wrote:
Then perhaps you can also include GetWeekDayInteger() to return a numeric indication of the week day?
Until then, this function will calculate it as an integer:
' 0=Sunday
Function GetDayOfWeek(date As Object) As Integer
daysFromEpoch = Int(date.AsSeconds() / 86400) + 1
day = (daysFromEpoch Mod 7) - 4 'epoch is a Thursday (4)
If day < 0 Then
day = day + 7
End If
Return day
End Function
It'd also be really nice to have a way to determine the current timezone offset for a given timezone, adjusting for DST. I have a need at the moment to convert all times to a specific timezone, but adjusting for DST has proven to be horribly complicated, particularly on the days that DST starts and ends.
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)