# Incorrect Time in payload

**URL:** <https://discourse.nodered.org/t/incorrect-time-in-payload/89296>\
**Category:** General\
**Created:** [5 July 2024 10:09 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296 "2024-07-05T10:09:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![petitxef](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/petitxef/32/92582_2.png) [@petitxef](https://discourse.nodered.org/u/petitxef)\
**Post date:** [5 July 2024 10:09 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296/1 "2024-07-05T10:09:33Z")

</div>

Hi everyone!

I'm using "get history" node to pull out info about an entity (TV LG).

Also I use node red 4.0.2 and a RPi 4 with HA:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3d72d214013c5a914e9ce1a4e7624ac9195218e.png)

The time that shows in the payload (last\_changed / last\_reported / last\_updated) they are not correct.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/ed2ce78568fc27756607c22c515fab3a47f826c7.png)

I checked the time in HA & the TV and both are correct.

What I need to change to show the correct time?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [5 July 2024 10:25 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296/2 "2024-07-05T10:25:06Z")

</div>

The times are GMT or UTC time you would need to correct them to your local time zone, you would normally do this prior to displaying, otherwise it is best to keep them as UTC .  
There is a [moment node](https://flows.nodered.org/node/node-red-contrib-moment) which you can use to convert to your local time, this can also be done using javascript in a function node or JSONata in a change node. Some dashboards also allow conversion to local time when displaying.

---

<div class="post-metadata">

**Author:** ![petitxef](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/petitxef/32/92582_2.png) [@petitxef](https://discourse.nodered.org/u/petitxef)\
**Post date:** [5 July 2024 12:52 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296/3 "2024-07-05T12:52:28Z")

</div>

Thanks!

Seems that with "Date/time formatter" node works fine.

Thanks

---

<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:** [5 July 2024 15:56 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296/4 "2024-07-05T15:56:40Z")

</div>

> [@petitxef](#):
>
> The time that shows in the payload (last\_changed / last\_reported / last\_updated) they are not correct.

Note that the times are, in fact, correct. It is just that they are not formatted the way that you want them.

---

<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:** [19 July 2024 15:57 UTC](https://discourse.nodered.org/t/incorrect-time-in-payload/89296/5 "2024-07-19T15:57:17Z")

</div>

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