I’ve just been looking to calculate the local time’s offset from UTC on the client side… thank you both for this post!
I’ve managed to work it out by stripping the Z away from the UTC time…
<dmx-datetime id="local_datetime"></dmx-datetime>
<dmx-datetime id="utc_datetime" utc="true"></dmx-datetime>
<dmx-value id="utc_offset_seconds"></dmx-value>
utc_offset_seconds.setValue(local_datetime.datetime.secondsUntil(utc_datetime.datetime.split('Z')[0]))
For me one hour from UTC, it returns me -3600!
I set it once on page load, so it is not being continually updated every second to the same value.