Forum Discussion
tlikarish
4 years agoEmployee
Yeah – this is cumbersome at the moment, so hopefully can be improved down the line.
The best I could suggest is along the lines of what you were doing using the toLocaleDateTimeString. One of the things you can do is specify the time zone when you are converting to a String, which avoids having to figure out the offset yourself. Essentially something along the lines of this:
Date.now().withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0).toLocaleDateTimeString({"timeZone":"US/Eastern", "format":"yyyy-MM-dd'T'HH:mm:ssZZ"})
which as of today returns the String "2022-01-11T19:00:00-05:00"
.
That should give you something you could then parse and compare with your other UTC values.