How to change Date from String into DateTime format

You have been told multiple times that you cannot use a string to define the time when entering data into InfluxDB. You need to convert the string to a number of seconds from epoch (i.e. a Unix time) and use that when inserting the data.

That statement confuses me, and I think you may be confused about the difference between JSON and javascript objects. JSON is a string representing a javascript object. So when the data comes in from MQTT you want to convert it to a javascript object, not convert it to JSON. In fact if, in the MQTT node you tell it to output a parsed JSON object that tells it to expect JSON coming in and convert it to a javascript object.

The second point is that you are making the writing to influx much more complex than it needs to be, I think. If you always want to write the data with the current timestamp then you don't need to worry about timestamps at all, use the normal influx out node and send it the data in the correct structure and will add the timestamp for you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.