Datetime formatting not working in multibinding

I have a javascript time stamp (milliseconds) in Node red that I wish to display in a formatted manner -eg 15:31.

I have tried a multibinding with a formatter {0:MM-dd-yy hh:mm:ss} but the formatting is ignored and I just get a very large number of milliseconds displayed. (Any formatter seems to be ignored.)

I have tried sending the time in seconds instead of milliseconds but still just get the number of seconds shown

If I convert the timestamp in node red and send the structure as follows:-
new Date(myTimestamp)
I just get a displayed string of the form “2022-06-24T15:3112.360Z” It still ignores the formatting

What am I doing wrong? What format do I need to provide the timeStamp in for it to work?

Thanks for your help.

Based on what you are saying, it sounds like the native type for this value is a number (assuming it’s a milliseconds value). Formatting can’t convert types. For this to work, your Home Remote Plugin should use the JS Date type.

Thanks. That worked. In the mqtt plug in I set the attribute value as follows

                    case "BoostTime":
                        var theDate = new Date(Number(payload));
                        device["BoostTime"] = theDate;
                        break;

I can then format it as wanted in the multibinding.

1 Like