Help

DATETIME_FORMAT and SET_TIMEZONE for NOW()

Topic Labels: Formulas
Solved
Jump to Solution
1786 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Sara
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi, I'm feeling a little stupid in this moment, because I know that I'm doing a little mistake🤣 but I can't find it!

I need to print the actual hour, so if now it is 10:31 am, I need that the result is 10. I'm trying to use DATETIME_FORMAT and SET_TIMEZONE.. but it gives me error.

Sara_0-1696256969397.png

 

do you know how can I solve this problem?

 

1 Solution

Accepted Solutions
NicoB
5 - Automation Enthusiast
5 - Automation Enthusiast

Hmmmm i guess that depend on your account time zone

To avoid the issue, try this :
DATETIME_FORMAT(SET_TIMEZONE(NOW(), 'America/New_York'), 'H')

 

See Solution in Thread

4 Replies 4
NicoB
5 - Automation Enthusiast
5 - Automation Enthusiast

Here's how you can format the current time to display just the hour in Airtable:

DATETIME_FORMAT(NOW(), 'h')

This formula will return the current hour in a 12-hour clock format. If you want it in a 24-hour clock format, you can use 'H' instead of 'h':

DATETIME_FORMAT(NOW(), 'H')

 

Sara
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi, thank you for your help, I tried this, but it gave me the wrong time.. but at the moment is 10:50 am

Sara_0-1696258224867.png

 

For this reason, I thought about set a time zone

 

NicoB
5 - Automation Enthusiast
5 - Automation Enthusiast

Hmmmm i guess that depend on your account time zone

To avoid the issue, try this :
DATETIME_FORMAT(SET_TIMEZONE(NOW(), 'America/New_York'), 'H')

 

Sara
8 - Airtable Astronomer
8 - Airtable Astronomer

It works now! Thank you very much!