var tima = "2021-02-09T07:36:40:000Z.";
const ss = Number(String(datec).substr(11, 2);
This outputs 07 which is what you would expect
This is what is on node red but the var tima is replaced with msg.payload.datetime which exactly the same as 2021-02-09T07:36:40:000Z as above:.
var tima = msg.payload.datetime;
msg.payload = Number(String(tima).substr(11, 2));
msg.payload outputs 07 which is what NOT what I expected.
Can any kind person tell me where I am going wrong. Thanks....