Question

Date transformation not working as expected

  • 26 May 2023
  • 3 replies
  • 53 views

I have a timestamp that looks like this:

2023-05-25T14:51:58-07:00

I would like to strip the time out, leaving only the date. Result would be this:

2023-05-25

I am using the Zapier formatter to convert date formats. In this step, it appears to work correctly.

This is what I have:

Running the test of the step returns the expected value:

output: 2023-05-25

In the next step, I pull that output, like this:

However, in that step, when I test the action, this value is converted to this:

output: 2023-05-25 0:00:00

 

Result when I test the action: 0:00:00 is getting added

I realize that I could just split the text, but I wanted to make sure I was doing this correctly.

Thank you!

 

 


3 replies

Userlevel 7
Badge +14

Hi @Sucesso 

Good question.

Looks like you are sending the value to GSheets, is that right?

If so, then GSheets can interprets dates and numbers different from what you expect.

You can highlight the cell and adjust the formatting to specify the desired data format as YYYY-MM-DD.

 

 

OR you can use Airtable instead of GSheets which has standardized field types (e.g. date, datetime, checkbox, dropdown, single text, etc.) to better control the data.

Hi, @Troy Tessalone

Thanks for that.

Yes, I’m using Google sheets. I’ve not used Airtable before; it’s not that I’m against it, I’ve just not really needed to (as far as I know).

But a couple of points--first, this is the value that Zapier is returning even before it gets passed to Google sheets.

Also, I do have that column set to format the date in my preferred format; however, it doesn’t seem to work when a value is programmatically added.

I’m mainly hoping to get this set up the best way so that I don’t have to come back to revisit and fix later (ie, avoid any ‘technical debt’).

I think if I can’t get it working, I’ll just strip extraneous characters.

If this is what you’d do (I see you’re an expert), then that’s great; I’ll just do that.

Thank you for your help.

 

Userlevel 7
Badge +14

@Sucesso 

We’d need to see more and full screenshots with how your Zap steps are configured to have enough context. (DATA IN/OUT for each step)

 

This appears to be the DATA OUT from the GSheet step, meaning it’s returned from GSheets.

 

If you have the Zap ON, then you can test live, and check the Zap Runs to see the DATA IN/OUT for each Zap step to help troubleshoot: https://zapier.com/app/history/

Reply