Timezones and locales in Airtable

Prev Next

Plan Availability

All plan types

Permissions

  • Owner / Creator - Can add, delete, duplicate, rename, and customize fields

  • Editors - Sort, filter, group, hide, and copy field URL

  • Commenters / Read-only - Copy field URL

Platform(s)

Web/Browser, Mac app, and Windows app (with some additional limited support on mobile)

Timezones and locales overview

Airtable stores dates 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.

Setting timezones in Airtable

There are three ways to manually set a timezone for a date field:

  • 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.

  • 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.

Setting locales in Airtable

Note

Check out our Local modifiers article for a full list of all supported locales.

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'
)

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'
)

FAQs

Can Epoch or Unix time be converted in Airtable?

Yes. For some context, Epoch time is when 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).

So, if you have a number of records containing Epoch or 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.

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")