# Insert data from the past

**URL:** <https://community.influxdata.com/t/insert-data-from-the-past/39407>\
**Category:** InfluxDB 2\
**Tags:** influxdb\
**Created:** [November 20, 2024, 1:09pm UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407 "2024-11-20T13:09:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![derw0lf](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@derw0lf](https://community.influxdata.com/u/derw0lf)\
**Post date:** [November 20, 2024, 1:09pm UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407/1 "2024-11-20T13:09:12Z")

</div>

Hi there,  
I have a iot sensor which is sending the current measured value and the payload also contains historical measurements from the last 7 hours.  
Is there a way to insert the historical measurements into influxdb? Just tried to overwrite the “time” field but it seems not to work. Any hints?  
Thanks

---

<div class="post-metadata">

**Author:** ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)\
**Post date:** [November 20, 2024, 2:07pm UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407/2 "2024-11-20T14:07:44Z")

</div>

If the data contains the timestamp (in a supported format) you can use it and the data will be just fine, otherwise InfluxDB will use the insertion timestamp

---

<div class="post-metadata">

**Author:** ![derw0lf](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@derw0lf](https://community.influxdata.com/u/derw0lf)\
**Post date:** [November 20, 2024, 2:38pm UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407/3 "2024-11-20T14:38:51Z")

</div>

Thanks for your answer.  
I am just working with Node-Red and pushing the payload into the database.  
Just tried the following format:

```auto
{"device_eui":"0080E115005A0774","timestamp":"2024-06-08T22:15:18.000Z","volume":159.613,"source_time":"2024-11-08T02:15:18.000Z","lat":"0","lon":"0","time":"1717884918"}

```

I thought that “time” (epoch) would do it but no data is appearing in the database.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)\
**Post date:** [November 20, 2024, 3:27pm UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407/4 "2024-11-20T15:27:46Z")

</div>

The epoch format is the easiest one to handle, but I have no idea how Node-Red sends those data…  
are you writing directly to the database?  
which method and format do you use?

You need to know how that information gets serialized before being sent to InfluxDB, something is missing there…

---

<div class="post-metadata">

**Author:** ![derw0lf](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@derw0lf](https://community.influxdata.com/u/derw0lf)\
**Post date:** [November 21, 2024, 7:58am UTC](https://community.influxdata.com/t/insert-data-from-the-past/39407/5 "2024-11-21T07:58:15Z")

</div>

Hi,  
just found the solution:  
in Node-Red you have to pass the payload to the influxin-node with a “time” which contains the unix timestamp in milliseconds. When pushing this to influxdb it will save the dataset in the past.  
Thanks for your support!
