Error with SET_TIMEZONE

Hey guys, I’m having a problem when using a formula that refers to a column that uses SET_TIMEZONE

Here’s what I have

Column 1:

Formula:
DATETIME_FORMAT(SET_TIMEZONE(CREATED_TIME(),‘America/Sao_Paulo’), ‘DD/MM/YYYY’)

Output: 27/02/2020

Column 2:

Formula:
DATETIME_FORMAT({Colunm 1} ,‘MM/YYYY’)

Output: #ERROR!

Can you please show me what am I doing wrong?

Welcome to the Airtable community!

The formula that you have for Column 1 produces a text string, not a date/time object.

The DATETIME_FORMAT function expects a date/time object, not a text string.

Option 1:
You can turn the value from Column 1 back into a datetime object by using DATETIME_PARSE.

DATETIME_FORMAT(DATETIME_PARSE({Column 1}, 'DD/MM/YYYY'))

Option 2:
You can go use the same basic formula as for Column 1, but change the format options.

DATETIME_FORMAT(SET_TIMEZONE(CREATED_TIME(),'America/Sao_Paulo'), 'MM/YYYY')
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.