Syntax
SHIFTTIMEZONE(<date>;<Time Zone>;<Time Zone>)
Description
Adjust an incorrectly labeled date to the correct timezone.
This function allows you to assign a timezone to values in a date type column and then shift the date to a different time zone. The result of the function has a date column with the dates displayed in the Datameer instance's local timezone.
Timezones available for the To and From input fields in the function can be found on: http://joda-time.sourceforge.net/timezones.html
Examples
In this use case example, a user located in Berlin, Germany has pulled in log files from a server located in Los Angeles, USA. The dates extracted from the log files had no time zone stamp assigned.
Log_Time |
---|
Jul 15, 2015 02:00:00 AM |
Jul 15, 2015 03:00:00 AM |
Jul 15, 2015 04:00:00 AM |
Jul 15, 2015 05:00:00 AM |
Jul 15, 2015 06:00:00 AM |
Jul 15, 2015 07:00:00 AM |
Jul 15, 2015 08:00:00 AM |
Jul 15, 2015 09:00:00 AM |
Jul 15, 2015 10:00:00 AM |
Jul 15, 2015 11:00:00 AM |
Jul 15, 2015 12:00:00 PM |
Jul 15, 2015 01:00:00 PM |
Jul 15, 2015 02:00:00 PM |
Jul 15, 2015 03:00:00 PM |
These dates are currently being displayed in local time for the user's Datameer instance which is in Berlin. (GMT+2). The problem is that these time stamps for the log events that happened during Pacific time (GMT-7).
The SHIFTTIMEZONE function lets the user assign a timezone to a date column and then reassign it to a new timezone which updates the displayed results.
Below, the timezone for Berlin, Germany is being assigned, in the "From Timezone" field, as the initial incorrect timezone. The second field, "To Timezone", is assigning the date to be correctly identified in the Los Angeles, USA timezone.
The timezones are being shifted from GMT+2 to GMT-7.
Formula builder | |
---|---|
SHIFTTIMEZONE | |
Date | #Log_Time |
From Timezone | Europe/Berlin |
To Timezone | America/Los_Angeles |
The result of the function will have a date column with the dates displayed in the corrected timezone.
Here, the log time is now being shown correctly in Berlin, Germany (local server time) for the log events that took place in the Los Angles, USA timezone.
Log_Time | Timezone corrected log time |
---|---|
Jul 15, 2015 02:00:00 AM | Jul 15, 2015 11:00:00 AM |
Jul 15, 2015 03:00:00 AM | Jul 15, 2015 12:00:00 PM |
Jul 15, 2015 04:00:00 AM | Jul 15, 2015 01:00:00 PM |
Jul 15, 2015 05:00:00 AM | Jul 15, 2015 02:00:00 PM |
Jul 15, 2015 06:00:00 AM | Jul 15, 2015 03:00:00 PM |
Jul 15, 2015 07:00:00 AM | Jul 15, 2015 04:00:00 PM |
Jul 15, 2015 08:00:00 AM | Jul 15, 2015 05:00:00 PM |
Jul 15, 2015 09:00:00 AM | Jul 15, 2015 06:00:00 PM |
Jul 15, 2015 10:00:00 AM | Jul 15, 2015 07:00:00 PM |
Jul 15, 2015 11:00:00 AM | Jul 15, 2015 08:00:00 PM |
Jul 15, 2015 12:00:00 AM | Jul 15, 2015 09:00:00 PM |
Jul 15, 2015 01:00:00 PM | Jul 15, 2015 10:00:00 PM |
Jul 15, 2015 02:00:00 PM | Jul 15, 2015 11:00:00 PM |
Jul 15, 2015 03:00:00 PM | Jul 15, 2015 12:00:00 AM |
Datameer always uses the following format:
Three character month abbreviation (space) two digit day (comma)(space) four digit year (space) two digit hour (colon) two digit minute (colon) two digit second (space) two character meridiem notation.
(e.g., 12.01.2012 gets transferred to Jan 12, 2012 12:00:00 AM)
When selecting a pattern, you select the way the data gets parsed (your input format, this can be connected to your systems representation of dates and times).