JavaScript object to Json node network

0

I am trying to pass a javascript object generated by my network node to json format.

The object script that is obtained is an hour and minutes that is written on the screen, for example "13:02"

I want to get a json type {"hora" : "hh:mm"} This is the code:

msg.payload = hour+':'+minute;
return msg;
    
asked by Oscar C. 17.05.2017 в 10:10
source

1 answer

0
msg.payload = {
"time": hour+':'+minute
}
return msg;

On the other hand you can use:

This node allows you to pass from JSON and JSON string to string. Response obtained by hardillb

    
answered by 17.05.2017 в 12:39