Hi,
I am trying to do below, I have a date and time string which is in GMT and i want to have that printed in Roku devices timezone.
Here is the code I was trying
datestr = "2010-11-15 04:30:00.000"
dt = CreateObject("roDateTime")
dt.fromISO8601String(datestr)
'GMT Time
print "Date = " + dt.asDateString("long-date") + tostr(dt.getHours()) + ":" + tostr(dt.getMinutes()) + ":" + tostr(dt.getSeconds())
'Local Time
dt.toLocalTime()
print "Date = " + dt.asDateString("long-date") + tostr(dt.getHours()) + ":" + tostr(dt.getMinutes()) + ":" + tostr(dt.getSeconds())
Output I am getting is as below, Our Roku device is set to Eastern TimeZone
Date = Monday November 15, 20104:30:0
Date = Sunday November 14, 201023:30:0
I need to have the time part properly shown above, Am I doing something wrong in getting time ??