# Strange Time Difference in CRON Plus Node Trigger Time & Output

**URL:** <https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140>\
**Category:** General\
**Created:** [30 December 2023 21:30 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140 "2023-12-30T21:30:03Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 January 2024 19:01 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/21 "2024-01-03T19:01:02Z")

</div>

> [@Buckskin](#):
>
> just an interesting happening that would be good to get an answer for.

without wading through the code:

1. debug timestamp is applied client side before display
2. sleepy tab has queued events
3. when tab awakes and runs the JS code to enumerate the debug messages, the current time is used

It is only a recent thing (sleepy tabs) and there may be a better way to handle this, but I dont know what.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [3 January 2024 19:03 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/22 "2024-01-03T19:03:57Z")

</div>

For the moment I think a note somewhere that this occurs, if someone wants to check the actual time an event happened the log gives the answer.

I will note this as resolved

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 January 2024 22:07 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/23 "2024-01-03T22:07:05Z")

</div>

In theory we could somehow also send a timestamp from server side do the queue had the correct data in it but I bet we then get timezone issues on display side:-)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 January 2024 22:23 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/24 "2024-01-03T22:23:08Z")

</div>

> [@dceejay](#):
>
> but I bet we then get timezone issues on display side:-)

Not saying I wrote (then retracted) a very VERY similar comment 😛

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [3 January 2024 23:51 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/25 "2024-01-03T23:51:41Z")

</div>

I know nothing about how that would work, but --- as long as the time (including time zone) is the same as the time the message was actually recorded by whatever issued it, does it matter what time zone the display side is at?

So for example, if cronplus issues a scheduled output at 21:00 (whatever time zone) I would like the server debug time to reflect that, even if MY display time zone is different. How does that work at the moment, if I am an hour in advance of the server does the debug show the server time, or my time?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [4 January 2024 00:06 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/26 "2024-01-04T00:06:37Z")

</div>

> [@Buckskin](#):
>
> How does that work at the moment

The time stamp is generated in the browser, so it will be your local time, at the time the messages is **displayed** (as you have discovered - not necessarily the time it was sent)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 January 2024 00:07 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/27 "2024-01-04T00:07:06Z")

</div>

System and processing of date/time values should ALWAYS be in UTC/Zulu/GMT to avoid all issues around DST and timezones.

Only user display and user input should ever be in local time.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 January 2024 15:48 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/28 "2024-01-04T15:48:59Z")

</div>

> [@Steve-Mcl](#):
>
> sleepy tab has queued events

Does this suggest that the sleeping tab has kept the socket open so that it is still receiving the debug messages (and queuing them) in its sleep? If I suspend the laptop then messages that are generated while it is suspended get lost, not queued. I presume that happens because the socket drops out.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 January 2024 19:22 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/29 "2024-01-04T19:22:14Z")

</div>

> [@Colin](#):
>
> Does this suggest that the sleeping tab has kept the socket open so that it is still receiving the debug messages (and queuing them) in its sleep?

I think that is only possible if the page has a service worker that handles the socket, it won't happen with a standard page I know that. ~~Not sure~~ Just checked, the Editor doesn't use a service worker.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 January 2024 20:44 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/30 "2024-01-04T20:44:23Z")

</div>

Does that mean that the messages are being queued in node red?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 January 2024 21:27 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/31 "2024-01-04T21:27:40Z")

</div>

I can't think of another mechanism - doesn't mean there isn't one of course. 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 January 2024 21:38 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/32 "2024-01-04T21:38:05Z")

</div>

I wonder what the difference is between a sleeping tab and a suspended laptop.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 January 2024 21:38 UTC](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140/33 "2024-01-18T21:38:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/strange-time-difference-in-cron-plus-node-trigger-time-output/84140.md?page=1)
