datetime(solved)

I know i’m missing something silly but can’t see it.

thisclock = createObject("roDateTime")
		thisclock.tolocalTime()

This is producing GMT time in 24hour mode. The roku is set to 12 hour.
So right now its 5pm (MST) and thisclock.GetHours() is reading 23

Thanks

At what point are you looking at thisclock.GetHours()? It works for me if I print thisclock.GetHours() right after your thisclock.toLocalTime() statement. If you call thisclock.Mark() at some later point, you’ll have to call thisclock.toLocalTime() again. Also, GetHours() will always return a number between 0 and 23 inclusive.

-JT

“renojim” wrote:
At what point are you looking at thisclock.GetHours()? It works for me if I print thisclock.GetHours() right after your thisclock.toLocalTime() statement. If you call thisclock.Mark() at some later point, you’ll have to call thisclock.toLocalTime() again. Also, GetHours() will always return a number between 0 and 23 inclusive.

-JT

Thank you. I knew it was simple. I was calling local time before the while loop and then only mark during the loop. (floating screensaver clock)

“toLocalTime()” is better to think as “addTimeZone()” - that’s all it does.

Say player is set as being on the west coast (PST = GMT-8), then each call will subtract 8 hours (make that 7 since this week) from the time value. Repeated calls will keep subtracting more hours repeatedly (there is a mathemagical warning about non-idempotence). roDateTime does not keep internal flag if that’s local or universal timestamp, the function is just a single-direction mutator