# Date format headache

**URL:** <https://discourse.nodered.org/t/date-format-headache/100592>\
**Category:** General\
**Created:** [18 March 2026 14:05 UTC](https://discourse.nodered.org/t/date-format-headache/100592 "2026-03-18T14:05:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [18 March 2026 14:05 UTC](https://discourse.nodered.org/t/date-format-headache/100592/1 "2026-03-18T14:05:36Z")

</div>

Debug sidebar has a very nice feature for values that look like unix timestamps, where you can click on it and immediately translate to human readable date. I should say human readable-ish, because I get horrendous formatting like M/dd/YYYY, h:mm:ss AM/PC [UTC+1]. So this is instant headache and potential source of bugs based on misunderstanding. So this must be a browser things sure? No possible fix in any browser I tried edge, chrome, firefox. But surely a plugin? Nah. But OS datetime format? Already have that set up in Windows 11 so clock shows YYYY-MM-dd. But somehow somewhere OS language is picked up. I prefer english language, possibly US or GB. But I never want those langauges to apply formatting! Anyone have a simple fix for this? Whenever I google browser formatting, it shows this is a discussed problem for years, but no solution.

It is such a pain I wish perhaps node red could take control and overwrite it regardless of browser/OS regional language format settings.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 March 2026 14:20 UTC](https://discourse.nodered.org/t/date-format-headache/100592/2 "2026-03-18T14:20:01Z")

</div>

The first rotation of a date-like number should show the ISO8601 format representation:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6c31b76d7fa726471373387ed1c78938ff87ad45.png)

Which is perfectly human readable isn't it?

Personally I _always_ use ISO date/time formats as they are easily read and process well too.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [19 March 2026 11:13 UTC](https://discourse.nodered.org/t/date-format-headache/100592/3 "2026-03-19T11:13:11Z")

</div>

Yes that's very good. But I also started appreciating converting to timezone. And the pandoras box opened.

---

<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:** [19 March 2026 11:35 UTC](https://discourse.nodered.org/t/date-format-headache/100592/4 "2026-03-19T11:35:35Z")

</div>

I am not sure what you are asking for. Are you asking for node-red in the debug tab showing a timestamp, to not let the browser convert to the local time format for you but have a way of configuring node-red to show it in the format that you want?

For me, in the uk, when I click on the timestamp in the debug pane it shows ISO mode and then 19/03/2026, 11:29:49 [UTC0] which is what I expect when seeing local time format.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [19 March 2026 13:50 UTC](https://discourse.nodered.org/t/date-format-headache/100592/5 "2026-03-19T13:50:28Z")

</div>

Yeah preferably wish toconfigure node red to hardcode date format on local time, or it used some sensible format and regardless ignore browser and/or OS language. Because no where I look can I find a way to solve this. It works on my work laptop because I set windows language to Swedish (!) which has a nice date format that propagates into browser's locale, but it has some other consequences of getting swedish weekdays some times.

Asked chatgpt about it and it was insistant that browser couldn't solve this at all, and the only way to fix it was in source code ☹

I enjoy seeing this: `2026-03-19T13:52:09.994Z`  
But I hate seeing this: `19/03/2026, 11:29:49 [UTC0]`  
Or even this (which I see at home): `3/19/2026, 9:15:41 AM [UTC+1]` 🤢

You have the luxury of having same local time as UTC 😄

---

<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:** [19 March 2026 14:11 UTC](https://discourse.nodered.org/t/date-format-headache/100592/6 "2026-03-19T14:11:25Z")

</div>

> [@ThingsTinkerer](#):
>
> 3/19/2026, 9:15:41 AM [UTC+1]

What was the actual local time then? Maybe do it again now to check time and display.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [19 March 2026 14:25 UTC](https://discourse.nodered.org/t/date-format-headache/100592/7 "2026-03-19T14:25:25Z")

</div>

The windows clock is adjusted correctly so assumed that configuration didn't have effect in browser/nr. So worst case it just reads windows language and defines format based on that. I don't want to change language on my home pc. Or I would have to go down the rabbit hole again and see which language is closest to english and still has sensible default date format.

---

<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:** [19 March 2026 14:47 UTC](https://discourse.nodered.org/t/date-format-headache/100592/8 "2026-03-19T14:47:57Z")

</div>

So was the local time 09:15 and is your timezone UTC+1? If so then it is at least showing the correct time.

Looking at the code it appears to use Date().toLocalString() to format it, and then adds the timezone.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [20 March 2026 07:58 UTC](https://discourse.nodered.org/t/date-format-headache/100592/9 "2026-03-20T07:58:50Z")

</div>

The time is certainly correct, but horrendous formatting. And I have no hope of browsers allowing to configure this, at least it has never worked for firefox, chrome an edge so far. Which means this is either handled by source code or OS language. And it's a bit much to change OS language to get date formatting in node red 😛

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 March 2026 08:18 UTC](https://discourse.nodered.org/t/date-format-headache/100592/10 "2026-03-20T08:18:36Z")

</div>

I thought there was an option in the editor settings to set the preferred language?  
( but that may only be for the message translations)

I’m not sure you have actually shown us what a preferred date would look like to you.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [20 March 2026 08:25 UTC](https://discourse.nodered.org/t/date-format-headache/100592/11 "2026-03-20T08:25:53Z")

</div>

Anything closer to or eual to ISO. Ie. something closer to `2026-03-20T08:17:20+00:00 UTC+XX:00` (but `[UTC+1]` is also fine) or similar to whatever NR shows for UTC. And much much further away from `3/4/2026, 6:17:20 PM [UTC+1]` 😱 which is just begging for misinterpretation, false posisitives and positive negatives, introducing new bugs or investigating/fixing stuff which wasn't broken.

Windows clock which I am allowed to set myself I use `YYYY-MM-dd HH:mm:ss` which I do prefer, but even ISO is huge improvement over whatever browser decides is local.

---

<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:** [20 March 2026 09:02 UTC](https://discourse.nodered.org/t/date-format-headache/100592/12 "2026-03-20T09:02:57Z")

</div>

> [@ThingsTinkerer](#):
>
> it's a bit much to change OS language to get date formatting in node red

According to my searches you can set the language in the browser, but I have not tried it.

The source for generating the output appears to be in the file [packages/node\_modules/@node-red/editor-client/src/js/ui/utils.js](https://github.com/node-red/node-red/blob/master/packages/node_modules/%40node-red/editor-client/src/js/ui/utils.js) in the function formatNumber (search for toLocaleString). If you really want to change this you could fork node-red and edit it yourself and build your own node-red variant. The current code, if I have found the correct place, is

```auto
        } else if (format === 'dateML') {
            var dd = new Date(obj);
            element.text(dd.toLocaleString() + " [UTC" + ( dd.getTimezoneOffset()/-60 <=0?"":"+" ) + dd.getTimezoneOffset()/-60 +"]");
        }

```

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [20 March 2026 10:02 UTC](https://discourse.nodered.org/t/date-format-headache/100592/13 "2026-03-20T10:02:34Z")

</div>

According to all my searches and findings, changing date format in browser is futile:  
[Setting Time and Date format in WIndows 11 / Edge - Microsoft Q&A](https://learn.microsoft.com/en-us/answers/questions/2408254/setting-time-and-date-format-in-windows-11-edge)  
[Switching from Chrome to Firefox, unable to set date/time format. : r/firefox](https://www.reddit.com/r/firefox/comments/1efhz3p/switching_from_chrome_to_firefox_unable_to_set/)

I tried this in firefox, but it didn't work:  
[How can I change the date format in Firefox without changing the language in Firefox? - Super User](https://superuser.com/questions/1751692/how-can-i-change-the-date-format-in-firefox-without-changing-the-language-in-fir)

This is an annoyance which I go down the rabbit hole once every other year, and each team ends up disappointed ☹

---

<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:** [20 March 2026 10:28 UTC](https://discourse.nodered.org/t/date-format-headache/100592/14 "2026-03-20T10:28:59Z")

</div>

I must admit that for me it is not be a big issue, I am not sure I have ever looked at the local time version (before this thread). Even when we are in summer time (UTC+1) I tend to think in UTC when looking at times in the debug pane.

As a workaround you can put this in the debug node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00b97bd11a013f4ac5822b6573f0c14710360906.png)

```flows
[{"id":"bd8a209d91b053b1","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":20,"wires":[["8cc3554b1dbfc130"]]},{"id":"8cc3554b1dbfc130","type":"debug","z":"bdd7be38.d3b55","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"$fromMillis(payload, '[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')","targetType":"jsonata","statusVal":"","statusType":"auto","x":360,"y":20,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [20 March 2026 10:30 UTC](https://discourse.nodered.org/t/date-format-headache/100592/15 "2026-03-20T10:30:03Z")

</div>

If clicking to cycle through the debug output formats till you get to the one you want is too annoying, which I can understand, how about inserting a dayjs node?

By default it will give an ISO date/time string, but you can format the output as you like, including changing timezones.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10a35a72290dee8ebf65013922cf33e3626296e0.png)

Incidentally, in making the above pic, I noticed that a debug node seems to remember and repeat the date format it last showed

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 March 2026 10:52 UTC](https://discourse.nodered.org/t/date-format-headache/100592/16 "2026-03-20T10:52:23Z")

</div>

> [@Colin](#):
>
> if I have found the correct place, is
> 
> ```auto
> } else if (format === 'dateML') {
> var dd = new Date(obj);
> element.text(dd.toLocaleString() + " [UTC" + ( dd.getTimezoneOffset()/-60 <=0?"":"+" ) + dd.getTimezoneOffset()/-60 +"]");
> }
> 
> ```

Hmm, that might benefit from some modernisation. We have the INTL library now which can output locale-specific formats.

I must admit though that I rather agree that, in general, locale dates are rubbish. "YYYY-DD-MM HH:mm:ss [timezone]" would likely be a much better option all round.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 March 2026 11:32 UTC](https://discourse.nodered.org/t/date-format-headache/100592/17 "2026-03-20T11:32:50Z")

</div>

Surely you mean YYYY-MM-DD hh:mm:ss.sss (TZ) ? ( in order of decreasing units)

And always happy to look at a PR

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 March 2026 15:59 UTC](https://discourse.nodered.org/t/date-format-headache/100592/18 "2026-03-20T15:59:39Z")

</div>

> [@dceejay](#):
>
> Surely you mean YYYY-MM-DD

Oops! 😃 Just checking people are awake of course. 😳

> [@dceejay](#):
>
> And always happy to look at a PR

Will add it to my rather long list unless someone beats me to it (hopefully).

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [20 March 2026 17:54 UTC](https://discourse.nodered.org/t/date-format-headache/100592/19 "2026-03-20T17:54:08Z")

</div>

Yeah to remember last date format you chose is so awesome! However I'm looking at an array with thousands of datapoints, each with their own timestamp. Not sure if day.js is useful for that?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [20 March 2026 20:48 UTC](https://discourse.nodered.org/t/date-format-headache/100592/20 "2026-03-20T20:48:01Z")

</div>

I suspect that you could use a change node with jsonata to apply day.js formatting to every array element.  
I am sure it's possible but I don't know the syntax.

[Next page](https://discourse.nodered.org/t/date-format-headache/100592.md?page=2)
