# Tt.mm.yyyy value to timestamp

**URL:** <https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347>\
**Category:** General\
**Created:** [29 August 2021 06:49 UTC](https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347 "2021-08-29T06:49:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [29 August 2021 06:49 UTC](https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347/1 "2021-08-29T06:49:19Z")

</div>

hello  
i have a Node 'function' where i do add some information manualy.

there i have a  
let myDatum = "17.06.2021" ; // tt.mm.yyyy

i would like to have the Datum changed (timestamp) to save it in InfluxDB so in Grafan could visualise the date (Datum) with some other values.

but just can't find out how to change the datum

have a nice day  
vinc

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 August 2021 07:22 UTC](https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347/2 "2021-08-29T07:22:47Z")

</div>

You can use the Date object

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fbd236177d64459f79faf9ba8a79fb8568c6df81.png)

If you have no choice in the Datum format then you can always split it by `.` and reverse it & feed it in that way...

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

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [29 August 2021 07:23 UTC](https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347/3 "2021-08-29T07:23:51Z")

</div>

Sounds like a job for Google...

[https://www.google.com/search?q=convert+day+month+year+to+timestamp+javascript](https://www.google.com/search?q=convert+day+month+year+to+timestamp+javascript)

...and then put the formula into your function node.

**EDIT** - I was just going through the top hit from Google when I saw that Steve beat me to this... I will go back to my movie 😛

---

<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:** [28 October 2021 07:23 UTC](https://discourse.nodered.org/t/tt-mm-yyyy-value-to-timestamp/50347/4 "2021-10-28T07:23:57Z")

</div>

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