# Getting date in nodered

**URL:** <https://discourse.nodered.org/t/getting-date-in-nodered/16182>\
**Category:** General\
**Created:** [2 October 2019 07:21 UTC](https://discourse.nodered.org/t/getting-date-in-nodered/16182 "2019-10-02T07:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venom](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@Venom](https://discourse.nodered.org/u/Venom)\
**Post date:** [2 October 2019 07:21 UTC](https://discourse.nodered.org/t/getting-date-in-nodered/16182/1 "2019-10-02T07:21:44Z")

</div>

Hey.  
I've tried getting date in javascript using the "new Date()" It works but I only want hours, minutes, secs, day, month and year. I don't want it to tell me which timezone I'm in. Is there any way to do that in node red?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [2 October 2019 07:26 UTC](https://discourse.nodered.org/t/getting-date-in-nodered/16182/2 "2019-10-02T07:26:05Z")

</div>

[https://flows.nodered.org/node/node-red-contrib-simpletime](https://flows.nodered.org/node/node-red-contrib-simpletime) or [https://flows.nodered.org/node/node-red-contrib-moment](https://flows.nodered.org/node/node-red-contrib-moment) perhaps?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 October 2019 07:31 UTC](https://discourse.nodered.org/t/getting-date-in-nodered/16182/3 "2019-10-02T07:31:51Z")

</div>

Or as you are already using javascript in a function node just use the javascript Date  
to do it  
[https://www.w3schools.com/jsref/jsref\_obj\_date.asp](https://www.w3schools.com/jsref/jsref_obj_date.asp)

---

<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:** [2 October 2019 09:11 UTC](https://discourse.nodered.org/t/getting-date-in-nodered/16182/4 "2019-10-02T09:11:40Z")

</div>

> [@Venom](#):
>
> I don't want it to tell me which timezone I'm in

The JS Date object is in UTC by definition. You cannot have a date/time without a timezone of some sort since that wouldn't make sense. All time is relative. Work in UTC by default, convert to local time only for user display or user input.

In addition to the other nodes mentioned, the inject node has a timestamp option and the change node can use JSONata which can also output a date/time.
