HTTP/Webhook - How to insert DATE value without TIME

Hi, I have an HTTP/Webhook step and am populating field values from a JSON response. However, I am trying to insert a date without the time value.

For example, the DateTime value I am receiving from the JSON payload is 2022-11-07T12:46:45.232Z and I am wanting to reduce it to 2022-11-07. How do I go about doing this?

Hi @slader

First off, welcome to the Pipedream community. Happy to have you!

What you’re looking for is called date formatting.

We actually just included an example of building a date formatting step in our docs here:

You can copy and paste that code in that example into a Node.js code step to reuse it in your own workflow.

Here’s a short video on how to build it and use it:

1 Like

Thank you so much, seems to be working like a charm to bring up the formatted date input, however, I looked through https://date-fns.org/ and must say I’m still struggling to figure out how to define the date format. I’m trying to set the format to yyyy-mm-dd

Watch this part of the video where we go over a similar format:

It includes using day, month and year. You can just modify that example with dashes to accomplish what you’re looking for. Best of luck!

Fantastic, it is working now, yyyyMMdd. Thanks very much!