Yeah, ok.... But.... Sorry.
If you load my flow, it works. No offence.
I saw yours and am not sure what the end user variable is.
Is it thenDate?
I tried that in my flow and it doesn't add the 7 minutes
.
This is a screen show of the flow (first)
I'm saving electrons with the dark theme.
and this is the code.....
[{"id":"5f87a73b.0cee58","type":"function","z":"b9924a74.4d98f8","name":"","func":"// 7 Minutes: = 420 seconds\n// = 420,000 milliseconds\n\nlet x = msg.payload;\nlet y = x + 420000;\nmsg.payload = y;\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":380,"wires":[["2d62af02.39668"]]},{"id":"7f497037.b6a308","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":340,"wires":[["715d141b.5acfd4","24d55edb.5f1792","5f87a73b.0cee58","4b3cf3a3.11aae4"]]},{"id":"2d62af02.39668","type":"moment","z":"b9924a74.4d98f8","name":"","topic":"","input":"","inputType":"msg","inTz":"","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"","output":"","outputType":"msg","outTz":"","x":490,"y":380,"wires":[["d4b5e8b9.1aeb58"]]},{"id":"24d55edb.5f1792","type":"moment","z":"b9924a74.4d98f8","name":"","topic":"","input":"","inputType":"msg","inTz":"","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"","output":"","outputType":"msg","outTz":"","x":490,"y":340,"wires":[["7a8932e6.53e174"]]},{"id":"4b3cf3a3.11aae4","type":"function","z":"b9924a74.4d98f8","name":"","func":"// Get current time as millisecs since epoch\nvar now = Date.now();\n\n// Add 7 minutes (in millisecs)\nvar then = now + 7*60*60*1000;\n\n// Get Date object for 7 mins from now\nvar thenDate = new Date(then);\n\nmsg.payload = then;\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":450,"wires":[["620ce857.0e48c"]]},{"id":"d4b5e8b9.1aeb58","type":"debug","z":"b9924a74.4d98f8","name":"Future","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":380,"wires":[]},{"id":"7a8932e6.53e174","type":"debug","z":"b9924a74.4d98f8","name":"NOW","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":340,"wires":[]},{"id":"620ce857.0e48c","type":"moment","z":"b9924a74.4d98f8","name":"","topic":"","input":"","inputType":"msg","inTz":"","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"","output":"","outputType":"msg","outTz":"","x":490,"y":450,"wires":[["ad2ee59.4548118"]]},{"id":"ad2ee59.4548118","type":"debug","z":"b9924a74.4d98f8","name":"Future 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":700,"y":450,"wires":[]}]
It isn't I want to hi-jack the thread, but I am not getting why it isn't adding the 7 minutes when I put in your but of code rather than mine.
The outputs are "now"
the second debug
is my code
the third debug
is with your code.