Issue with format date

Hi all,

I have a simple webhook catch from a form with a date in it. the date comes formatted as: 2017-01-01T00:00:00.000Z. I am trying to use format date to return the format mm/dd/yyyy (01/01/2017 in the example) by using {{formatDate(1.date_of_birth; “mm/dd/yyyy”)}} in the column B cell.

Step 1: Catch hook from form
Step 2: Add row to google sheets w new formatted date from function format date.
Issue: the dob goes in as raw data but shows something else in the formula
Issue: the output is garbage



When the data is outputted to the sheet it is: 00/Sa/2016


Step 2c sheets output

You are using lowercase in the in the date formatting.
Try this example
{{formatDate(parseDate("December 31, 2016 7:00 PM"; "MMMM DD, YYYY h:mm A"); "MM/DD/YYYY")}}

You could reference the formatting here

2 Likes

Thank you but I got this error message.

Failed to map ‘values.1’: Function ‘formatDate’ finished with error! Function ‘parseDate’ finished with error! ‘2023-01-07T00:00:00.000Z’ is not a valid date or does not match the date format.
See screen shots.



You could try this
{{formatDate(parseDate("2023-01-07T00:00:00.000Z"; "YYYY-MM-DD"); "MM/DD/YYYY")}}
it depends on what you have as your date format on your google sheet.
I just gave an example and the reference doc. The reference doc will help you match it up.

1 Like

perfect, worked great

1 Like