Working with the time sensitive data can get easily complicated because of the timezone.
When you import data with timezone offset information, then the time will be imported as you would expect.
Time with Timezone info:
time |
---|
2018-05-09T13:10:00-08:00 |
2018-05-10T12:00:00-08:00 |
2018-05-15T09:30:00-08:00 |
The above data will be imported and setup as UTC (Coordinated Universal Time, a.k.a. U.K. time zone).
The time part of the informaiton is appropriately re-calculated by respecting the time zone offset and it is displayed in UTC
But, when you import the date/time data, it will be imported as UTC timezone.
Time without Timezone info:
time |
---|
2018-05-09T13:10:00 |
2018-05-10T12:00:00 |
2018-05-15T09:30:00 |
The above data will be imported and setup as UTC.
But of course this can be wrong if you don’t live in the UTC timezone.
By the way, in Exploratory (or in R) the data type for date and time data is called POSIXct. If the data includes only date then it is Date. In case your time data is imported as character instead of POSIXct, then you can convert the data type from the column header menu.
The timezone that is wrongly set is not the worst part of the problem. The worst part is that sometimes it’s hard to know what is the time zone your time data is setup for. Is that UTC? PT (US Pacific Time)? JT (Japan Time)?
Exploratory started showing the time zone that is used for the data from v5.0 in Table view for all POSIXct data type columns.
Once you know how the data is set for the timezone then it’s relatively easy to fix.
You want to show the time in your timezone?
You can use ‘with_tz’ function to convert the timezone.
Select
Replace / Fill / Convert Data -> Convert Timezone
from the column header menu.
Select the timezone you want from the suggested list.
Now you will see the converted time displayed in the selected timezone.
If your data is mistakenly registered as UTC when you imported the data you can fix it by using ‘force_tz’ function.
Select
Replace / Fill / Convert Data -> Fix Timezone
from the column header menu.
Select a timezone you want the data to be set to.
You will see the time portion of the data unchanged, but the timezone is updated.