# Storing timestamp

**URL:** <https://discourse.nodered.org/t/storing-timestamp/46501>\
**Category:** General\
**Created:** [31 May 2021 09:49 UTC](https://discourse.nodered.org/t/storing-timestamp/46501 "2021-05-31T09:49:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmkarNodered](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@OmkarNodered](https://discourse.nodered.org/u/OmkarNodered)\
**Post date:** [31 May 2021 09:49 UTC](https://discourse.nodered.org/t/storing-timestamp/46501/1 "2021-05-31T09:49:02Z")

</div>

Hello, I want to store time stamp after data get stored into csv file so, How do I create timestamp and store it along with data in csv file?

---

<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:** [31 May 2021 09:50 UTC](https://discourse.nodered.org/t/storing-timestamp/46501/2 "2021-05-31T09:50:21Z")

</div>

I think a change node can generate a timestamp.

If not, a function node with `var ts = Date.now();` will do the job.

If you want more help, provide more details & a demo flow.

---

<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:** [31 May 2021 20:19 UTC](https://discourse.nodered.org/t/storing-timestamp/46501/3 "2021-05-31T20:19:40Z")

</div>

If the target output is a CSV file, you also need to think about the output format. If you follow Steve's advice, you will most likely end up with ISO8601 format, e.g. `2021-05-31T15:45:00.000Z`. Meaning that the timestamp will also be in the UTC timezone. That's a common format clearly readable by humans and machines but not all applications will recognise it.

---

<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:** [30 July 2021 20:20 UTC](https://discourse.nodered.org/t/storing-timestamp/46501/4 "2021-07-30T20:20:40Z")

</div>

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