# Date / Format in a script

**URL:** https://discourse.nodered.org/t/date-format-in-a-script/72919
**Category:** General
**Created:** [29 December 2022 21:04 UTC](https://discourse.nodered.org/t/date-format-in-a-script/72919 "2022-12-29T21:04:38Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [29 December 2022 21:17 UTC](https://discourse.nodered.org/t/date-format-in-a-script/72919/6 "2022-12-29T21:17:15Z")

</div>

That's not an array but an object.  
Is it just one element of an array of similar events?

You can use moment in a Change node, though I'm not familiar with the syntax. There is an example [here](https://discourse.nodered.org/t/using-moment-in-change-node-jsonata-test-results-in-an-error/37995/5)

So a split, a change node applying your reformat change to msg.payload.event\_date and a join should work.

---

_[View the full topic](https://discourse.nodered.org/t/date-format-in-a-script/72919)._
