# Monthly signal - help please

**URL:** <https://discourse.nodered.org/t/monthly-signal-help-please/24125>\
**Category:** General\
**Created:** [3 April 2020 05:27 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125 "2020-04-03T05:27:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 05:27 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/1 "2020-04-03T05:27:37Z")

</div>

(Brain failure)

I'm wanting a _monthly_ signal to happen at ...... 23:50. (say)  
(Sorry.... The _rub_: **last day of the month** )

The `inject` nodes doesn't quite seem to do that.

`cronplus` may. `bigtimer` seems possible too.

But I just can't get my head around how to do it.

Someone - please.

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [3 April 2020 06:01 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/2 "2020-04-03T06:01:25Z")

</div>

You can use an inject node and a very simple function node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8a5e731968a647f3c123b4ec534111413a0901b.jpeg)

```auto
[{"id":"8a7ca794.3fa14","type":"function","z":"f954564f.03e718","name":"is tomorrow the 1st?","func":"let date = new Date(msg.payload+86400000); //create a date object from the timestamp plus one day\nlet day = date.getDate(); //get the corresponding day\nif(day==1){ //check if tomorrow is the 1st\n return msg;\n}else{\n return null; //else do nothing\n}","outputs":1,"noerr":0,"x":440,"y":3840,"wires":[["26e1d7e1.e15c5"]]},{"id":"67f730c5.493e6","type":"inject","z":"f954564f.03e718","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"50 23 * * *","once":false,"onceDelay":0.1,"x":230,"y":3840,"wires":[["8a7ca794.3fa14"]]},{"id":"26e1d7e1.e15c5","type":"debug","z":"f954564f.03e718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":3840,"wires":[]}]

```

A timestamp is injected at 23:50 everyday and we than check in a function if tomorrow is the first, otherwise we return nothing:

```auto
let date = new Date(msg.payload+86400000); //create a date object from the timestamp plus one day
let day = date.getDate(); //get the corresponding day
if(day==1){ //check if tomorrow is the 1st
    return msg;
}else{
    return null; //else do nothing
}

```

Johannes

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 06:06 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/3 "2020-04-03T06:06:37Z")

</div>

Ok. Thanks.

I'll look at it.

I'm guessing all those times are local and not `Zulu` time. (Sorry I have had a few problems with time zones, and just want to be sure.)

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [3 April 2020 06:08 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/4 "2020-04-03T06:08:05Z")

</div>

This will be whatever time the machine nodered runs on uses as we generate the Date object from the base of the timestamp from the inject node.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 06:09 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/5 "2020-04-03T06:09:14Z")

</div>

Ok. Again: Thanks.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [3 April 2020 06:28 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/6 "2020-04-03T06:28:18Z")

</div>

With cronplus you could use:

 ![Screenshot 2020-04-03 at 08.27.35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d0004aa63c035bf19cb3fcd07e50da4fd054076d.jpeg)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 06:29 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/7 "2020-04-03T06:29:04Z")

</div>

Ah! I missed the `L` flag.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [3 April 2020 06:30 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/8 "2020-04-03T06:30:46Z")

</div>

It is not a standard cron feature (ie: not available everywhere), but is a very useful one in this case!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 06:32 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/9 "2020-04-03T06:32:19Z")

</div>

Yeah. Thanks.

I was nearly going to make it at 00:10:00 on the first day of the month.  
It isn't that critical.

But for the sake of getting it as I want, it is good to know and learn.

---

<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 April 2020 11:42 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/10 "2020-04-03T11:42:17Z")

</div>

> [@bakman2](#):
>
> It is not a standard cron feature (ie: not available everywhere)

While this is not a standard, `L` is employed by a quite a few cron implementations I've seen, including Quartz.

Its even listed on [wikipedia](https://en.wikipedia.org/wiki/Cron#CRON_expression) (so it must be popular 😉 )

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 April 2020 20:36 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/11 "2020-04-03T20:36:14Z")

</div>

Yeah, thanks.

I did google it and did a bit of digging. But I didn't see that mentioned/listed/shown.

Anyway, it is now resolved and again: Thanks to all who responded.

---

<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:** [17 April 2020 20:36 UTC](https://discourse.nodered.org/t/monthly-signal-help-please/24125/12 "2020-04-17T20:36:17Z")

</div>

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