# TimeDate to Filename

**URL:** https://discourse.nodered.org/t/timedate-to-filename/78201
**Category:** General
**Created:** [5 May 2023 07:26 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201 "2023-05-05T07:26:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![docsfs](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/docsfs/32/79597_2.png) [@docsfs](https://discourse.nodered.org/u/docsfs)
#### Post date: [5 May 2023 07:26 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201/1 "2023-05-05T07:26:24Z")

</div>

Sorry i'm totally new to Node-Red. I find hundreds of topics to put the date/time into the file and append the file with every new protocol, but i need separate files.

How can i create a file with the date and time in the name.

I`ve got an lab-instrument which sends a protocol via serial port after each processing cycle.  
Serial-in (node-red-node-serialport) is connected to write-file. That work so far, but how can i get a Filename with Date and Time in it to create a separate file for each protocol.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [5 May 2023 07:47 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201/2 "2023-05-05T07:47:38Z")

</div>

Have you tried searching the [forum](https://discourse.nodered.org/t/new-name-for-every-picture/75089/3)

---

<div class="post-metadata">

### Author: ![docsfs](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/docsfs/32/79597_2.png) [@docsfs](https://discourse.nodered.org/u/docsfs)
#### Post date: [5 May 2023 08:10 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201/3 "2023-05-05T08:10:45Z")

</div>

I`ve searched the forum and on google. But so far i find topics how to get a timestamp in the msg.payload or how to extract it from the the payload...

But i don't want to mess with the payload that's all fine as it is, i just need a separate unique filename for every protocol-event.

---

<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: [5 May 2023 09:17 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201/4 "2023-05-05T09:17:18Z")

</div>

I think the link that @E1cid provided with his rhetorical question could help. 😀

---

<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: [19 May 2023 09:17 UTC](https://discourse.nodered.org/t/timedate-to-filename/78201/5 "2023-05-19T09:17:30Z")

</div>

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