Hi, I just want to have the actual hour as a number.
So I´ve build:
[
{
"id": "9c8c4170df54250b",
"type": "inject",
"z": "7b74e2db318add18",
"name": "Zeitstempel",
"props": [
{
"p": "payload"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 870,
"y": 1380,
"wires": [
[
"84bf06adf76d82e3"
]
]
},
{
"id": "84bf06adf76d82e3",
"type": "change",
"z": "7b74e2db318add18",
"name": "Uhrzeit in h",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$moment(payload.date).locale(\"de\").tz('Europe/Berlin').format('HH')",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1090,
"y": 1380,
"wires": [
[
"4101478478a454f1"
]
]
},
{
"id": "4101478478a454f1",
"type": "function",
"z": "7b74e2db318add18",
"name": "Uhr",
"func": "msg.payload = Number(msg.payload);\nmsg.topic = \"Uhr\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1110,
"y": 1340,
"wires": [
[
"fb91e1a51ca592be"
]
]
}
]
Question: Is it possible to convert in Jsonata expression? so that the function can be deleted?