# Feedback: Adding format options to 'timestamp' Inject option

**URL:** https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419
**Category:** Core Development
**Created:** [4 December 2023 17:08 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419 "2023-12-04T17:08:29Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)
#### Post date: [11 December 2023 12:12 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419/21 "2023-12-11T12:12:42Z")

</div>

> [@Colin](#):
>
> I think the default should be local, in fact I am not sure that the UTC versions are particularly useful.

Usually if I want timestamp as a string I need something meaningful, which is local time. I am not living in the UK, hence UTC usually is not helpful.  
So far I would use an inject node followed by a function node:

```auto
msg.payload = new Date().toLocaleString()
return msg;

```

So, I'd vote for possibility to have local time. Offering UTC is a nice option, too.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [11 December 2023 16:03 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419/22 "2023-12-11T16:03:32Z")

</div>

For anyone interested, I'm continuing work on this feature on my live stream now - [Twitch](https://twitch.tv/knolleary)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [11 December 2023 18:03 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419/23 "2023-12-11T18:03:00Z")

</div>

I spent 10 minutes going in circles over what options to include before throwing the towel in and moving on to something more productive.

I'm sure there's a good answer to be had that balances all of the feedback received - but I also think it's going to involve improving our timezone/locale handling more generally.

---

<div class="post-metadata">

### Author: ![emberbrook](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@emberbrook](https://discourse.nodered.org/u/emberbrook)
#### Post date: [2 January 2024 18:40 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419/24 "2024-01-02T18:40:26Z")

</div>

To control regular daily activities I use the date formatter node's hh:mm:ss in local time and split and multiply this in a function node to create milliseconds past midnight. This takes three simple nodes. Is it worth making a drop down which is potentially more complicated and confusing than three nodes?

---

<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: [2 March 2024 18:40 UTC](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419/25 "2024-03-02T18:40:38Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/feedback-adding-format-options-to-timestamp-inject-option/83419.md?page=1)
