Cron-plus not providing correct sunrise/set times in payload but correct time under the node

Node-RED v 4.0.5 - cron-plus v2.1.0
MacOS Sequoia v15.1.1

I'm trying to get sunrise and sunset times using latitude/longitude settings in the settings location. While the sunrise time is correct in the display under the cron-plus node, it does not show the same date/time in the payload:

Any thoughts on this?

The difference is because CRON+ is reporting time in EST but the debug node is showing the time in UTC (AKA GMT, AKA "Zulu" - hence the "Z" at the end of the output).

I would think that cron+ should be outputting the time based on the lat/lon so it would agree what it is displaying under the node. A Coordinated Universal Time is 5 hours ahead of Boston, MA but the node output only shows a two hour difference.

CRON+ outputs a date object. It is node-red that is showing the ZULU time.

Proof:

[{"id":"75a6bc5e5f8cad7f","type":"cronplus","z":"854cb259ba408a9a","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"42.357589794193025 -71.07847546460107","defaultLocationType":"fixed","outputs":1,"options":[{"name":"schedule1","topic":"sunrise+sunset","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise,sunset"}],"x":1170,"y":300,"wires":[["e3566f614224aac2","60ce631317d0eea4"]]},{"id":"e3566f614224aac2","type":"function","z":"854cb259ba408a9a","name":"proof","func":"const info = {}\nconst now = new Date()\ninfo.time0 = msg.payload.status.solarTimes[0].time\ninfo.time0local = info.time0.toLocaleString()\ninfo.time0Type = typeof info.time0\ninfo.time0name = msg.payload.status.solarTimes[0].event\n\ninfo.time1 = msg.payload.status.solarTimes[1].time\ninfo.time1local = info.time1.toLocaleString()\ninfo.time1Type = typeof info.time1\ninfo.time1name = msg.payload.status.solarTimes[1].event\n\nnode.warn(info);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1330,"y":260,"wires":[[]]},{"id":"60ce631317d0eea4","type":"debug","z":"854cb259ba408a9a","name":"solarEvent","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.status.solarTimes","targetType":"msg","statusVal":"","statusType":"auto","x":1350,"y":300,"wires":[]}]

In future, to save me recreating the node, please export the CRON node. Thanks.

1 Like

Your pic correctly shows the node status EST as 5 hours behind the debug's UTC?