Dayjs() uses browser timezone - can it be forced to use a different timezone?

I have an openHAB system in timezone A.

In that openHAB system I have a DateTime Item dtPumpOn.

I am administering/monitoring that openHAB system from timezone B in a browser.

I would like a widget to show the number of hours between now and the time in dtPumpOn. The following partly works:

dayjs().diff(@'dtPumpOn','hours')

Unfortunately, the dayjs() part generates a timestamp based on the timezone of the browser, in timezone B, and diffs it against the timestamp in dtPumpOn which is in timezone A. But it doesn’t take account of timezones.

  • So if timezone A was UTC+8, and dtPumpOn contained 06:00:00 (for simplicity).
  • And timezone B was at UTC, where it is now 21:00:00.
  • The real elapsed time between these two timestamps is 7hrs, but the js expression above calculates this difference as 15hrs because it doesn’t take into account the timezones.

Is there anything I can do within the widget to force the timezones to be taken into account?

(I tried the dayjs.tz() and dayjsLocal() functions, but these don’t seem to be supported?)