EQL provides two functions to obtain the corresponding timestamp in different time zones.
For example, TO_TZ(dateTime,'America/New_York') answers the question, "What time was it in America/New_York when it was dateTime in GMT?"
For example, FROM_TZ(dateTime,'EST') answers the question, "What time was it in GMT when it was dateTime in EST?"
The following table shows the results of several time zone expressions:
Expression | Results |
---|---|
TO_TZ(TO_DATETIME('2012-07-05T16:00:00.000Z'), 'America/New_York') | 2012-07-05T12:00:00.000Z |
TO_TZ(TO_DATETIME('2012-01-05T16:00:00.000Z'), 'America/New_York') | 2012-01-05T11:00:00.000Z |
FROM_TZ(TO_DATETIME('2012-07-05T16:00:00.000Z'), 'America/Los_Angeles') | 2012-07-05T23:00:00.000Z |
FROM_TZ(TO_DATETIME('2012-01-05T16:00:00.000Z'), 'America/Los_Angeles') | 2012-01-06T00:00:00.000Z |