in code:
def fTime = timeToday(fromTime2, location.timeZone)
def tTime = timeToday(toTime2, location.timeZone)
ST input preferences:
fromTime2 time 23:00
toTime2 time 05:00
ST log output:
rooms child ruleNo: 2 | fromTime2: 2017-12-31T23:00:27.000-0800 | fTime: Mon May 21 06:00:00 UTC 2018 | toTime2: 2017-12-31T05:00:27.000-0800 | tTime: Mon May 21 12:00:00 UTC 2018 | nowDate: Mon May 21 22:36:56 UTC 2018 | timeOfDayIsBetween: false
Hubitat input preferences:
fromTime2 time 22:00
toTime2 time 06:00
Hubitat log output:
rooms child ruleNo: 2 | fromTime2: 2018-05-21T22:00:00.000+0000 | fTime: Mon May 21 22:00:00 UTC 2018 | toTime2: 2018-05-21T06:00:00.000+0000 | tTime: Tue May 22 06:00:00 UTC 2018 | nowDate: Mon May 21 22:31:26 UTC 2018 | timeOfDayIsBetween: true
so input time preferences like fromTime2
is stored as 2018-05-21T22:00:00.000+0000
without actually converting it to UTC. whereas ST correctly stores it in the hub local timezone.
thanks.
edit: currently having to hack it to get it to work right:
if (hT == _Hubitat) {
if (fromTime2) fromTime2 = fromTime2.replace("+0000", "-0800")
if (toTime2) toTime2 = toTime2.replace("+0000", "-0800")
}