renojim
16 years agoCommunity Streaming Expert
roDateTime fromISO8601String
I'm trying to initialize an roDateTime object from an ISO8601 date/time string. From the Roku DVP Component Reference:
The first thing to note is that the example does not follow the ISO8601 standard, it should be "2009-01-01T01:00:00.000". But, that doesn't work either. I've tried every possibility of moving the year around, with and without fractional seconds, with and without timezone offsets, etc., but the following code always shows that the date/time object never changes:
I can change the value using the fromSeconds() function, but not the fromISO8601String() function.
Have I just not stumbled upon the magic string to make the function happy, or is it safe to say that this isn't really implemented even though it's in the documentation?
-JT
Void fromISO8601String(String dateString)
• Initialize the date/time using a string in the ISO8601 format. For example “01-01-2009T01:00:00.000â€
The first thing to note is that the example does not follow the ISO8601 standard, it should be "2009-01-01T01:00:00.000". But, that doesn't work either. I've tried every possibility of moving the year around, with and without fractional seconds, with and without timezone offsets, etc., but the following code always shows that the date/time object never changes:
dt = CreateObject("roDateTime")
print dt.asSeconds()
dt.fromISO8601String("2009-01-01T01:00:00.000")
print dt.asSeconds()
I can change the value using the fromSeconds() function, but not the fromISO8601String() function.
Have I just not stumbled upon the magic string to make the function happy, or is it safe to say that this isn't really implemented even though it's in the documentation?
-JT