I am using text input in dashboard / UI to set time.
What is the output format of the time set ?
When i set time to 01:00 i received the value 3600000 . How could i convert this number to "readable" and how could i split the number in Hours and minutes ?
Thanks , the node-red-contrib-moment gives me the output > payload: "2019-04-29T09:27:30.839Z".
Now my problems is hot to extract Hour and Minutes and split them ? I thought Node-Red would be only graphic but it requires knowledge that i don´t have .
ukmoose ,
I was googling in a wrong direction. Thanks for showing me a better path to search.
I am very newbie on this subject so ; my understanding is that " d " is the variable " new Date ( ) but how should i know that adding a " d." to getHours() gives me a result ? Where can i learn this sintax ?
d is better described as a variable which references a Date object, which is set to the current date/time.
When you use d.something you are asking the Date object referenced by d to do something, in this case to call a member function Date.getHours() which is documented in many places which can be found as suggested by ukmoose. The w3schools site is a good place for information on javascript (and other web stuff).
Thanks for the explanation and links. Another doubt ;
Below an excerpt of a function to convert a number format.
var newMsg = { payload: decimal }; > This adds the value of Variable decimal to payload , right ? Where or what should i search for learning this syntax ? return newMsg;
It doesn't add the value of decimal to the msg.payload, it sets newMsg to an object that has a property payload which has the value from the variable decimal.
These are basic javascript features, so any javascript tutorial or documentation will teach you these concepts. Though the problem with javascript tutorials is that they tend to assume you are using the js in a website with html, whereas here it is being used as a standalone language. Whether anyone can recommend a particular one I don't know.
True, and often annoying. The w3schools site has a separate section on node.js that uses examples from running server-side programs and provides a programming tool. I haven't used it much, so I can't vouch for its quality.