Today's problem for me....
I have the msg.payload
loaded with the time as an array (I think that is the right term).
So (example)
msg.payload.0
is the seconds.
msg.payload.1
is the minutes.
msg.payload.2
is the hour.
and so on.
Problem
I would prefer the values are formatted with 2 digits.
So if values are less than 10
there is a leading 0
.
This is what I have to create the message:
[{"id":"314fee2e910159cc","type":"template","z":"0918ee609bf69fc7","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.7}}/{{payload.6}}/{{payload.5}} {{payload.2}}:{{payload.1}}:{{payload.0}}","output":"str","x":4570,"y":590,"wires":[["d1f86109c5af8059"]]}]
Rather basic, yes.
I have never really got the C++
command worked out and so doing it in Javascript is asking a bit much.
Someone - please.