Timezones and locales in Airtable

Plan AvailabilityAll plan types
Required permissionsOwner / Creator - Can add, delete, duplicate, rename, and customize fields
Platform(s)Web/Browser, Mac app, and Windows app (with some additional limited support on mobile)

Dates stored in Airtable are in Greenwich Mean Time (GMT). However, how they can be displayed in your collaborator's local time or the same time zone for all collaborators.

There are three ways to manually set a timezone for a date field: using the "Use same timezone for all collaborators" toggle in the field configuration menu and selecting the desired timezone OR using a formula field with the SET_TIMEZONE() or DATE_ADD()  functions. Using the toggle is the easiest option and works well for cases where you want the specified timezone to be used 100% of the time. For more complex cases where you might want to conditionally show different timezones, we recommend one of the formula options.

  • Setting a timezone in the date field configuration menu - You can choose a specific timezone for a date field by toggling the option to "Use the same time zone for all collaborators" in the field configuration menu. You will then be able to choose your desired timezone from a drop-down list. GMT/UTC will be chosen by default.

    2023-02-22_Set-timezone-in-date-field

  • Setting a timezone with a SET_TIMEZONE() formula function - The SET_TIMEZONE()function will allow you to set the timezone for the data from a date type field. This is written in the form SET_TIMEZONE(datetime, 'timezone identifier'), in which the format specifier can be something like 'America/Chicago', 'Europe/Oslo', or 'Pacific/Marquesas'. For a full list of supported timezone identifiers, see this article.

    • Whenever you need to set a timezone, you'll need to use this function in combination with DATETIME_FORMAT(). You'll first write the DATETIME_FORMAT() function, and then wrap that function with SET_TIMEZONE().

    • For example, if a date field is configured to not use GMT time; therefore, the date will be shown in your local timezone (CST). Using the combination of SET_TIMEZONE()and DATETIME_FORMAT(), you can convert what's shown in the date field to Los Angeles time: DATETIME_FORMAT( SET_TIMEZONE(Date, “America/Los_Angeles”), “M/D/Y h:mm A”)

    • There's just one problem, the result of this formula is not a formatted date that's readable by Airtable. Remember that DATETIME_FORMAT() converts datetimes into strings. We'll need to use DATETIME_PARSE() to transform this string into a readable date. The {Set Timezone} field is referenced instead of using the original formula above to keep the formula simplified: DATETIME_PARSE( {Set Timezone}, “M/D/YYYY h:mm A”)

    • The output of this formula is now a formatted date. Now that we've gone over the separate parts of this formula, let's bring it all together into a single formula: DATETIME_PARSE( DATETIME_FORMAT( SET_TIMEZONE(Date, "America/Los_Angeles"),'M/D/Y h:mm A'),'M/D/YYYY h:mm A')

    • Notice that the option to "Use the same timezone for all collaborators" is toggled on and the timezone is set to GMT in the field formatting settings. This is needed to display the correct time after manually setting the timezone with the formula.

  • Setting a timezone using a DATEADD() formula function - There's another way to specify timezones that can, at times, be a more simple approach. We've already reviewed the use of DATEADD(); now we'll look at how to use this function alongside timezones.

    • Remember that the structure of that function is: DATEADD(Date, #, "units")

    • Since every timezone in the world is offset a certain number of hours from GMT time, we can easily specify a timezone without using the SET_TIMEZONE() function. Here are a few cities listed with the difference, in hours, from GMT:

      • New York: -4

      • Chicago: -5

      • San Francisco: -7

      • London: +1

    • This formula will convert the GMT time to the local timezones, which are each specified by how many hours they are offset from GMT: DATEADD({GMT Date}, {GMT Diff}, "hours")

    • Note that this approach can be helpful if a date needs to be specified in GMT time, but collaborators in other regions need to see that time translated to their local timezone.

NOTE

For a full list of all locales, see this support article.

Now that we've translated a local time to a specified timezone, let's look at how to further transform that into a locale (a specific language or region).

The SET_LOCALE()function takes a given datetime input and formats it to match a particular locale. This function is written in the form SET_LOCALE(datetime, 'locale modifier'), in which the locale modifier can be something like 'en-nz' (New Zealand English), 'tzm' (Amazigh/Berber), or 'zh-tw' (Traditional Chinese).

Locale modifiers can change a number of different aspects of a datetime, including:

  • Numerical digits: for certain locales not using West Arabic numerical digits, numerical digits will be converted, e.g. for 'ar' (Arabic), 1 => ٢.

  • Script directionality: for locales using scripts that are written right-to-left, e.g. 'he' (Hebrew), the datetime will change direction accordingly.

  • Month and weekday names : month/weekday names will be changed to reflect the locale's language, e.g. for 'es' (Spanish), Wednesday => Miércoles.

  • Long date format : Long datetimes will be formatted according to the preferred format of the locale, e.g. for 'en-gb' (British English), 'MMMM D, YYYY h:mm A' => 'D MMMM YYYY HH:mm'.

As an example, we'll translate the datetime into Spanish. Here's the original formula:

DATETIME_PARSE(
   DATETIME_FORMAT(
      SET_TIMEZONE(
         Date, 'America/Los_Angeles'
      ),
   'M/D/Y h:mm A'),
'M/D/YYYY h:mm A'
)
Plain text

And here is that same formula with the added locale function:

DATETIME_FORMAT(
    SET_LOCALE(
        DATETIME_PARSE(
            DATETIME_FORMAT(
               SET_TIMEZONE(
                  Date, 'America/Los_Angeles'
               ),
            'M/D/Y h:mm A'),
         'M/D/YYYY h:mm A'
         ), 
    'ES'), 
'LLLL'
)
Plain text

Troubleshooting timezone issues

While formula functions help take a lot of trouble out of timezones, the nature of time differences can still be confusing from time to time. When something doesn’t work out the way you expected, you can often resolve the issue if you know how to troubleshoot.

Consider the following formula:

IS_SAME(NOW (),{Start Day & Time },'day ')
Plain text

Something’s not working quite right, but what could it be? Here’s the issue in detail:

You just started using IS_SAME() to match up dates that are the same. In your table, all tasks that have today's date are the same. However, some tasks have a timestamp occurring after 7:00 PM EST and those records are failing to match as TRUE (same) when compared with TODAY() using IS_SAME(). If you change the timestamp to be earlier than 7:00 PM EST everything works fine. Is it some fixed time zone issue with the TODAY() function?

For proper reference, these are the results you’re getting with the formula in question:

1500000448162timezone-8.jpg

We can assume that NOW() is correctly producing the same date as shown in the {Start Day & Time} field. Because NOW() is equal to 4/10/2020, the formula should produce a 1 for every record shown here.

In this case, the date field is displaying values in local time, while the NOW() formula is producing a date in GMT time, which for some of the records falls on the next day. Remember that all dates in Airtable are stored as GMT.

Is it possible to convert Epoch or Unix times?

Yes it is. For some context, Epoch time is defined as "the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a synonym for 'Unix time'.

So, if you have a number of records containing Epoch / Unix times expressed as raw seconds, you can use a DATEADD() function in a formula field to convert that to a more friendly date by adding however many seconds (as specified by your epoch time string) to 1/1/1970.

Here's an example using this formula: DATEADD(“1/1/1970”, {Epoch Time}, “seconds”)

Screen Shot 2019-04-22 at 3.45.02 PM

Alternatively, you may want to convert a date into Epoch / Unix time. For that, you would instead want to use a DATETIME_DIFF() function. The formula would look like this: DATETIME_DIFF({Friendly time}, "1/1/1970", "seconds")
Image showing a field containing epoch time, another field converting that to friendly time, then another back to epoch / unix time.