TommyD2
4 years agoNewbie
Convert time PDT (date string "2021-12-30T09:00:00-08:00" ) to UTC
I have a date string PDT "2021-12-30T09:00:00-08:00" and I want to convert it t date/time UTC. I have to try research on document Roku but it does not support it. I have to create the function with the idea
' Convert time PDT to UTC function convertPDTToUTC(dateStr as string) as string date = CreateObject("roDateTime") date.fromISO8601String(dateStr.Replace("[UTC]", "")) dateSC = date.AsSeconds() dateSC = dateSC + (7 * 60 * 60) datePDTToUTC = CreateObject("roDateTime") datePDTToUTC.FromSeconds(dateSC) return datePDTToUTC.ToISOString() end function
but look it does not work right in all cases.
Any advice or ideas from you are greatly appreciated, thanks.