# Increase timestamp

**URL:** <https://discourse.nodered.org/t/increase-timestamp/18452>\
**Category:** Dashboard\
**Created:** [26 November 2019 11:40 UTC](https://discourse.nodered.org/t/increase-timestamp/18452 "2019-11-26T11:40:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian19](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian19/32/23687_2.png) [@christian19](https://discourse.nodered.org/u/christian19)\
**Post date:** [26 November 2019 11:40 UTC](https://discourse.nodered.org/t/increase-timestamp/18452/1 "2019-11-26T11:40:08Z")

</div>

Hi!  
Im using a function node to set a time stamp. What I would like is to be able to manipulate the timestamp. Etc adding a hour.

"  
new\_msg = {  
payload: {  
ontime: msg.payload.substr(0,5),  
offtime: msg.payload.substr(0,5)  
}  
}  
return new\_msg;  
"  
This returns this:

object

ontime: "13:00"

offtime: "13:00"

Ideas on how to do that with the function node?

---

<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:** [26 November 2019 11:52 UTC](https://discourse.nodered.org/t/increase-timestamp/18452/2 "2019-11-26T11:52:25Z")

</div>

You will be much better off using Javascript's Date functions.

---

<div class="post-metadata">

**Author:** ![christian19](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian19/32/23687_2.png) [@christian19](https://discourse.nodered.org/u/christian19)\
**Post date:** [26 November 2019 11:55 UTC](https://discourse.nodered.org/t/increase-timestamp/18452/3 "2019-11-26T11:55:32Z")

</div>

That might be:).

Could you point me in the right direction?

---

<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:** [26 November 2019 11:59 UTC](https://discourse.nodered.org/t/increase-timestamp/18452/4 "2019-11-26T11:59:29Z")

</div>

MDN is always the best place to start looking for JavaScript reference info:

> **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)**
>
> Creates a JavaScript Date instance that represents a single moment in time in a platform-independent format.

I use it all the time as I can never remeber the exact parameters for things.

You need to create a Date variable - looks like you have an input date string - depending on the format of that and your locale, you should be able to use it as input to the Date function. From there on, it is all math 🤣
