# NodeRED \> Influx - Time way ahead

**URL:** https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784
**Category:** General
**Tags:** database
**Created:** [6 February 2023 13:43 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784 "2023-02-06T13:43:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![c.quint](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@c.quint](https://discourse.nodered.org/u/c.quint)
#### Post date: [6 February 2023 13:43 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/1 "2023-02-06T13:43:53Z")

</div>

Hi Community,

i am facing a weird problem. I try to use the node-red-contrib-influxdb node to store some data. After i inject, the data is stored in influxdb but the date is way off... checked system time on influx-server and node-red-host but they're fine.  
Time precission is set to milliseconds in influxdb-out-node.

Thanks for reading. Hope you have some hints.

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1ebfd9109861f8fb91c8971934674b32d56f0528.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 February 2023 15:04 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/3 "2023-02-06T15:04:03Z")

</div>

Are node-red or influxdb installed using Docker?  
Which version of node-red, node-red-contrib-influxdb, and influxdb server are you running?  
Also check the time and zone on the machine running the browser.

---

<div class="post-metadata">

### Author: ![c.quint](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@c.quint](https://discourse.nodered.org/u/c.quint)
#### Post date: [6 February 2023 17:38 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/4 "2023-02-06T17:38:17Z")

</div>

Hi Colin,

node-red: 3.0.2  
node-red-contrib-influxdb: 0.6.1

You're right! NodeRED and InfluxDB are installed using Docker.

Time and zone are also ok the machine running the browser.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 February 2023 18:31 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/5 "2023-02-06T18:31:56Z")

</div>

Open shells into the docker containers and check the date/time and zone there.

it is a longshot, but can I just check that when checking the system date you were not confused with European Vs American date formats?

---

<div class="post-metadata">

### Author: ![c.quint](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@c.quint](https://discourse.nodered.org/u/c.quint)
#### Post date: [6 February 2023 18:59 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/6 "2023-02-06T18:59:10Z")

</div>

Date in InfluxDB-Container:  
root@24e57e6ab7d0:/# date  
Mon Feb 6 18:57:18 UTC 2023  
root@24e57e6ab7d0:/#

Date in NodeRED-Container:  
bash-5.1$ date  
Mon Feb 6 18:58:05 UTC 2023  
bash-5.1$

seems like they're ok besides -1h off

[EDIT: Corrected Time in Containers to Europe/Berlin]

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 February 2023 20:45 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/7 "2023-02-06T20:45:16Z")

</div>

You didn't say which version of influxdb you are using. I guess it is 2.x, looking at the output in the screenshot. Are you using the latest 2.x version.

Very odd. When you send just a value to the influx out node the db server should add the timestamp as the current time.

What query are you using to get the data for the screenshot? Is it possible to show the time value as a number rather than interpreted as in your screenshot?

Can you select those three nodes and Export them and paste here please? I don't know what it will tell me, but you never know. When pasting use the `</>` button at the top of the forum entry window.

Is the problem consistent? If you write other data is it also 35 days in the future?

---

<div class="post-metadata">

### Author: ![c.quint](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@c.quint](https://discourse.nodered.org/u/c.quint)
#### Post date: [7 February 2023 06:24 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/8 "2023-02-07T06:24:28Z")

</div>

It seems like setting the time in the Docker-Container did the job.  
Don't know why but today i trye'd to insert some data and the date is ok.

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d4e83aeaa196eddb68f60e8bab5521d3cb812a86.png)

The query is just the standard mean with time-window in InfluxDB

```auto
from(bucket: "stromzaehler")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "1222323")
  |> filter(fn: (r) => r["_field"] == "value")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "mean")

```

Here comes the flow-json-export

```auto
[{"id":"1d309d49f4c62878","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"b9e9508e71065579","type":"debug","z":"1d309d49f4c62878","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":380,"y":40,"wires":[]},{"id":"b7b74e122516f074","type":"influxdb out","z":"1d309d49f4c62878","influxdb":"06b701234eeb0410","name":"out","measurement":"","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"hell@home","bucket":"stromzaehler","x":370,"y":80,"wires":[]},{"id":"1e925e6389d8b6aa","type":"inject","z":"1d309d49f4c62878","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":60,"wires":[["9e231fbea462b298"]]},{"id":"9e231fbea462b298","type":"function","z":"1d309d49f4c62878","name":"function 5","func":"msg.measurement = 1222323\nmsg.payload = {\n value: 424892348923\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":220,"y":60,"wires":[["b9e9508e71065579","b7b74e122516f074"]]},{"id":"06b701234eeb0410","type":"influxdb","hostname":"quintsor-castle.de","port":"8086","protocol":"http","database":"database","name":"","usetls":false,"tls":"","influxdbVersion":"2.0","url":"http://89.58.12.194:8086","rejectUnauthorized":false}]

```

The problem was consistent.

Thanks for your time and effort!

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [7 February 2023 09:30 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/9 "2023-02-07T09:30:03Z")

</div>

Did you drop the measurement and start again before each test? I wonder whether you had that record in there and later tests were adding new records at the right time but you were only seeing the one left from previous tests.

On a separate issue, that seems an odd measurement name. I am guessing, but do you have several measurements with similar names? If so then have you considered whether they should all be in one measurement with the number as a tag?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [8 April 2023 09:30 UTC](https://discourse.nodered.org/t/nodered-influx-time-way-ahead/74784/10 "2023-04-08T09:30:03Z")

</div>

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