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.
Language | Language code | Time zone |
---|---|---|
Brazilian Portuguese | pt_BR | America/Sao Paulo |
Chinese (Simplified) | zh_CN | Asia/Shanghai |
Chinese (Traditional) | zh_TW | Asia/Taipei |
Danish | da | Europe/Copenhagen |
Dutch | nl_NL | Europe/Amsterdam |
English UK | en_GB | Europe/London |
English US | en_US | America/Los Angeles |
French | fr | Europe/Paris |
German | de | Europe/Berlin |
Italian | it | Europe/Rome |
Japanese | ja | Asia/Tokyo |
Korean | ko | Asia/Tokyo |
Portuguese | pt_PT | Europe/Lisbon |
Russian | ru | Europe/Moscow |
Spanish | es | Europe/Madrid |
Swedish | sv | Europe/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.