I want to display Current time according to IST. I have done plus 5 in hours and 30 in min. but It's not the solution as it will do +5 when time is 23 also and +30 when min is already 60.
Pleas guide me with this.
I am trying to pass on date and time in different column of the table.
[{"id":"425b8a.987c8478","type":"debug","z":"34503490.74c53c","name":"","active":true,"console":"false","xaxis":"_time","complete":"false","x":1490,"y":560,"wires":[]},{"id":"6d6b5a1c.351ee4","type":"function","z":"34503490.74c53c","name":"","func":"var dateUTC = new Date();\nlet day = dateUTC.getDate();\nlet month =dateUTC.getMonth() + 1;\nlet year = dateUTC.getFullYear();\n\n\n//date shifting for IST timezone (+5 hours and 30 minutes)\nlet hour = dateUTC.getHours() + 5; \nlet min= dateUTC.getMinutes() + 30;\nlet sec = dateUTC.getSeconds();\n\nlet printdate = `${day}-${month}-${year}`;\nlet printtime = `${hour}:${min}:${sec}`; \n\n\n\nmsg.payload = [\n {\n \"Date\": printdate, \n \"Time\": printtime,\n },\n ];\n return msg;\n","outputs":1,"language":"javascript","noerr":0,"x":1320,"y":560,"wires":[["425b8a.987c8478"]],"_type":"node"},{"id":"d59e0171.98ced","type":"inject","z":"34503490.74c53c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","repeatEnd":"0","endTime":"0","crontab":"","offset":"0","once":false,"properties":"","timezone":"utc","betweentimesunit":"m","enableRuleEngine":false,"showNextExecution":false,"powerMode":false,"x":1120,"y":560,"wires":[["6d6b5a1c.351ee4"]]}]