# Msg.filename logging data

**URL:** <https://discourse.nodered.org/t/msg-filename-logging-data/1117>\
**Category:** General\
**Created:** [27 June 2018 09:34 UTC](https://discourse.nodered.org/t/msg-filename-logging-data/1117 "2018-06-27T09:34:40Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [27 June 2018 14:10 UTC](https://discourse.nodered.org/t/msg-filename-logging-data/1117/13 "2018-06-27T14:10:27Z")

</div>

In the spirit of "there's always another way to do it", I like to use the `node-red-contrib-moment` node whenever I need to format time and date strings. Here is an example of how to append the current timestamp formatted as YYYYMMDD to a static filename:

> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/5927d845b0a9c9a97ef0e1a00f32932cf8af44b3.png)

Just put whatever static strings you want inside `[...]` square brackets, set the input to be the current timestamp, and use any of [moment's many formatting directives](http://momentjs.com/docs/#/displaying/format/). In your case, you would also set the Output to `msg.` `filename` -- no programming needed!

---

_[View the full topic](https://discourse.nodered.org/t/msg-filename-logging-data/1117)._
