Get DATETIME Values in the Right Time Zone

When you call the Einstein NER (beta) endpoint and pass the timezone parameter, that parameter value takes precedence, and any DATETIME entities returned by the API are converted into that time zone. If you omit the timezone parameter, the DATETIME entity is normalized based on the language parameter value.

This table contains the time zones associated with each language.

LanguageLanguage codeTime zone
Brazilian Portuguesept_BRAmerica/Sao Paulo
Chinese (Simplified)zh_CNAsia/Shanghai
Chinese (Traditional)zh_TWAsia/Taipei
DanishdaEurope/Copenhagen
Dutchnl_NLEurope/Amsterdam
English UKen_GBEurope/London
English USen_USAmerica/Los Angeles
FrenchfrEurope/Paris
GermandeEurope/Berlin
ItalianitEurope/Rome
JapanesejaAsia/Tokyo
KoreankoAsia/Tokyo
Portuguesept_PTEurope/Lisbon
RussianruEurope/Moscow
SpanishesEurope/Madrid
SwedishsvEurope/Stockholm

If you specify a language but want to return the DATETIME entities in a different time zone, then you must pass the timezone parameter. For example, if you specify a language of English US, but you want to return DATETIME entities in the Eastern time zone, pass the timezone parameter with a value of America/New_York. To specify the time zone, see this list of tz database time zones for valid time zones, and use the TZ database name value from the table. For example, Africa/Abidjan.

Let’s say the current time is 1:00 pm (13:00) in the America/Los Angeles time zone. The following cURL call and the JSON response show the response if you pass a timezone parameter of Europe/London.

If you omit the timezone parameter, the DATETIME entity is normalized based on the language parameter value. Here's what the call and response looks like if you pass a language value of en_GB.

Here's what the call and response looks like if you pass a value of en_US. The time zone associated with en_US is America/Los Angeles.

If you omit the language parameter, the default language is en_US, and the DATETIME value is converted to the America/Los Angeles time zone.