# Cronplus Sunset

**URL:** https://discourse.nodered.org/t/cronplus-sunset/82621
**Category:** General
**Created:** [5 November 2023 13:55 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621 "2023-11-05T13:55:32Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 13:55 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/1 "2023-11-05T13:55:32Z")

</div>

I don't have experience with cronplus; however I've created a test flow that outputs at specific times that works without issue. The issue I'm seeing is "Sunset"; after setting my timezone I set a schedule for Sunset. After deploying I noticed at the bottom of the cronplus node it lists the next schedule: sunset Nov 5, 2023 12:48 EST - WHAT! That should have been more like 16:48 EST; to get it to display the proper sunset time for my area I had the set the time-zone to America/Scoresbysund (where ever that is - lol) GMT -1.

The time-zone for the PC Node-Red is running on is correct, and displays the correct time.

What am I missing? BTW: Suncalc displays the correct sunset time.  
X.

---

<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: [5 November 2023 14:13 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/2 "2023-11-05T14:13:11Z")

</div>

Check the timezone of the machine running the browser.

What OS/hardware are you running node red on?

Also show us how you have configured the cronplus node.

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 15:52 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/3 "2023-11-05T15:52:01Z")

</div>

Hi Colin,

Sorry it took so long to reply; I was on Skype with someone in Slovakia.

To answer your questions.  
The PC's running Node-Red & the dash-board have correct time-zone and times; as I mentioned Suncalc is working properly.  
Tho OS is Windows 10, for both PC's

Here is cronplus:

```auto
[
    {
        "id": "6899ca4fa12d4416",
        "type": "cronplus",
        "z": "5c6c548399542bca",
        "g": "890130a13d286321",
        "name": "",
        "outputField": "payload",
        "timeZone": "America/Scoresbysund",
        "storeName": "",
        "commandResponseMsgOutput": "output1",
        "defaultLocation": "",
        "defaultLocationType": "fixed",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "topic1",
                "payloadType": "str",
                "payload": "cronplus First Timeout",
                "expressionType": "cron",
                "expression": "0 30 20 * JAN-DEC *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            },
            {
                "name": "schedule2",
                "topic": "topic2",
                "payloadType": "str",
                "payload": "cronplus Second Timeout",
                "expressionType": "cron",
                "expression": "0 30 22 * JAN-DEC *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            },
            {
                "name": "schedule3",
                "topic": "topic3",
                "payloadType": "str",
                "payload": "cronplus Sunrise/Sunset",
                "expressionType": "solar",
                "expression": "0 * * * * * *",
                "location": "",
                "offset": "0",
                "solarType": "selected",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 260,
        "y": 1860,
        "wires": [
            [
                "d98594324c36bc0b"
            ]
        ]
    }
]

```

The time-zone you see is the one I had to select to get the proper sunset time for my area; which is US New York.

---

<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: [5 November 2023 15:53 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/4 "2023-11-05T15:53:39Z")

</div>

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

Also please post it without the hack on the timezone. We need an example that fails so we can test it.

---

<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: [5 November 2023 16:00 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/5 "2023-11-05T16:00:20Z")

</div>

> [@xytsrm](#):
>
> The PC's running Node-Red & the dash-board have correct time-zone and times

I was referring to the one running the browser, which is often a different machine to the one running node-red. I don't think it is a factor in this case but it is worth checking they are all the same to avoid confusion.

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:01 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/6 "2023-11-05T16:01:26Z")

</div>

When I said dash-board PC I was referring to the Browser PC; it's all ok.

---

<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: [5 November 2023 16:03 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/7 "2023-11-05T16:03:12Z")

</div>

Did you deliberately NOT enter any location coordinates?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0f2217e94e85301a2e70d3792eedb4f5ef59ff30.png)

Coordinates are REQUIRED to precisely calculate the exact sun time for you.

1. chose a position from the map (... button OR enter your coordinates manually)
2. clear the timezone (if your server time zone is correct)

* * *

I realise it states "optional" but that is because you might NOT be using solar events. For solar events, the node NEEDS to know where you are!

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:04 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/8 "2023-11-05T16:04:36Z")

</div>

It did say the Location coordinates were optional; in any case I had tried Location coordinates and it didn't make any difference.

---

<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: [5 November 2023 16:06 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/9 "2023-11-05T16:06:53Z")

</div>

> [@xytsrm](#):
>
> in any case I had tried Location coordinates and it didn't make any difference.

They are needed.

Set it up correctly and put your mouse in the offset box for a preview - what do you see?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b47829c6f42b7cbea5d9e25bafc476fec98fef28.png)

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:08 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/10 "2023-11-05T16:08:13Z")

</div>

I'll try it again, with the correct time-zone; standby.

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:12 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/11 "2023-11-05T16:12:43Z")

</div>

After correcting the time-zone, and enterring the location:  
Notice at the bottom of the cronplus node, it's list the next schedule at 8:30PM skipping over the sunset which would be about 5:50PM.

![Cronplus Image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/74a766668c3cd43098c3a8aff0734d589b4e0ccf.jpeg)

---

<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: [5 November 2023 16:14 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/12 "2023-11-05T16:14:36Z")

</div>

Please show me how you have setup the node AND please place your mouse in the "offset" field as I requested.

Also, show me what timezone is set on the device running Node-RED and its current time value.

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:18 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/13 "2023-11-05T16:18:58Z")

</div>

Every time I try to do a screenshot the window displaying with the mouse disappears. this is the best so far:

 ![Edit Cronplus image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc9860f9f6ff93911d794ee4c741ef4ea02d0ef3.jpeg)

It now says Sunset at the right time, but for the next day Nov 06; but suset for today hasn't occurred yet; It should be the next scheduled event.

UPDATE: I tried removing the "sunrise" leaving only the sunset; it still shows Schedule1 a 8:30PM next, and Sunset for the next day. BTW: when I said adding location didn't make a difference; that was the first thing I had tried and it kept saying the sunset would occur the next day. Then I took to location out and got the sunset for the current day, but at the wrong time.

---

<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: [5 November 2023 16:31 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/14 "2023-11-05T16:31:23Z")

</div>

> [@xytsrm](#):
>
> It now says Sunset at the right time, but for the next day Nov 06; but suset for today hasn't occurred yet; It should be the next scheduled event.

Which is why I asked for other details: Please provide the info requested.

> [@Steve-Mcl](#):
>
> Also, show me what timezone is set on the device running Node-RED and its current time value.

You can get this from the "System Info" CTRL+SHIFT+P

![chrome_gsuyaqA1Za](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19a9e0f2fe74fb83702ad4f6cdd584e74d917d85.gif)

  

Also, remove the timezone from the "Timezone" field as requested.

  

* * *
  

> [@xytsrm](#):
>
> Every time I try to do a screenshot the window displaying with the mouse disappears

This is normal for tooltips - that is why I use a shortcut (Print Screen button in my case)

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:34 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/15 "2023-11-05T16:34:04Z")

</div>

Colin the time-zones for all PC are set to East-coast USA New York; and as I said they're both display the correct time.  
 ![Time-Zone](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/89128d63d58ee484657991931bedf8a309861c3f.jpeg)

---

<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: [5 November 2023 16:35 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/16 "2023-11-05T16:35:49Z")

</div>

> [@xytsrm](#):
>
> the time-zones for all PC are set to East-coast USA New York

It is not that we don't believe you, but if you want further help, I would prefer not to be guessing.

please provide the info requested:

> [@Steve-Mcl](#):
>
> Please provide the info requested.
> 
> > [@Steve-Mcl](#):
> >
> > Also, show me what timezone is set on the device running Node-RED and its current time value.
> 
> You can get this from the "System Info" CTRL+SHIFT+P
> 
> ![chrome_gsuyaqA1Za](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19a9e0f2fe74fb83702ad4f6cdd584e74d917d85.gif)

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:40 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/17 "2023-11-05T16:40:19Z")

</div>

I think I found what you're looking for:

> "time": {  
> "utc": "Sun, 05 Nov 2023 16:38:29 GMT",  
> "local": "11/5/2023, 11:38:29 AM"

From Node-Red System Information; which appears correct.

---

<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: [5 November 2023 16:41 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/18 "2023-11-05T16:41:38Z")

</div>

And the `intl` timezone entry below the `time` entry (like on my screenshot)

---

<div class="post-metadata">

### Author: ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)
#### Post date: [5 November 2023 16:43 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/19 "2023-11-05T16:43:04Z")

</div>

> },  
> "intl": {  
> "locale": "en-US",  
> "timeZone": "America/New\_York"  
> },

Again it appears correct.

BTW: Here's the System Information for the PC running the server:

> "scope": "basic",  
> "time": {  
> "utc": "Sun, 05 Nov 2023 16:46:47 GMT",  
> "local": "11/5/2023, 11:46:47 AM"  
> },  
> "intl": {  
> "locale": "en-US",  
> "timeZone": "America/New\_York"  
> },

---

<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: [5 November 2023 16:47 UTC](https://discourse.nodered.org/t/cronplus-sunset/82621/20 "2023-11-05T16:47:40Z")

</div>

Import these 2 nodes and deploy - show me what they display

```auto
[{"id":"832f8b5683776813","type":"cronplus","z":"3a59b8d7dc9167b0","name":"","outputField":"payload","timeZone":"","storeName":"file","commandResponseMsgOutput":"output2","defaultLocation":"40.39 -74.115","defaultLocationType":"fixed","outputs":2,"options":[{"name":"sunup","topic":"topic1","payloadType":"default","payload":"","expressionType":"solar","expression":"0 0 6 * * 1-5 *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise"}],"x":400,"y":320,"wires":[[],[]]},{"id":"d982f721a5acc6e4","type":"cronplus","z":"3a59b8d7dc9167b0","name":"","outputField":"payload","timeZone":"","storeName":"file","commandResponseMsgOutput":"output2","defaultLocation":"40.39 -74.115","defaultLocationType":"fixed","outputs":2,"options":[{"name":"sunup","topic":"topic1","payloadType":"default","payload":"","expressionType":"solar","expression":"0 0 6 * * 1-5 *","location":"","offset":"0","solarType":"selected","solarEvents":"sunset"}],"x":400,"y":380,"wires":[[],[]]}]

```

`(CTRL-I, paste)`

I get:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1bc581aeab53bc00df78e4b3a2fe056506966fc4.png)

but I am in the UK (UTC: +00:00, DST: +01:00)

[Next page](https://discourse.nodered.org/t/cronplus-sunset/82621.md?page=2)
