WEBVTT

00:00.800 --> 00:06.260
Racking and handling time loans is considered one of the most unpleasant parts when working with time

00:06.260 --> 00:07.250
series data.

00:07.820 --> 00:13.580
If you have time serious data with daytime information first of all you never know which time zones.

00:13.610 --> 00:20.840
The daytime information is referring to and therefore many users choose to work with the Coordinated

00:20.960 --> 00:29.180
Universal Time or short UTC but as currently the international standard and among others the United

00:29.180 --> 00:34.100
Kingdom Portugal and Iceland are located in the UTC time zone.

00:34.100 --> 00:35.900
So let's have a look at an example.

00:35.900 --> 00:43.350
And we import pandas and then we import historical stock prices for General Electric.

00:45.020 --> 00:45.860
Let's have a look here.

00:46.280 --> 00:53.570
So here we are on the left hand side a daytime index and we have actually time increments of 30 minutes

00:54.200 --> 01:01.030
and we actually open high low close and volume data so let's have a more detailed look here.

01:01.320 --> 01:03.920
And uh we uh.

01:04.030 --> 01:07.190
Salmon the first uh 30 timestamps.

01:07.280 --> 01:15.380
So actually here we are starting at nine thirty eight uh 10 a.m. Then we have for the next period from

01:15.500 --> 01:18.680
10 a.m. to 10 30 and so on.

01:18.680 --> 01:27.870
And actually the very last the timestamp on a day is actually here from 15 30 to 4:00 p.m. So these

01:27.880 --> 01:32.670
are actually the irregular trading hours on the New York Stock Exchanges.

01:32.730 --> 01:40.440
So this daytime information is they are actually based on New York time are actually Eastern time and

01:40.440 --> 01:48.270
actually New York Time or Eastern time is four hours behind UTC and we can also get some meta information

01:48.270 --> 01:58.260
here so that's a daytime index and let's have a closer look on the index and apparently here we cannot

01:58.260 --> 02:06.870
see any information on the time zone and we can explicitly get information on the time so nervous.

02:06.900 --> 02:08.300
The index method.

02:08.340 --> 02:16.800
T said and obviously here we have no information on the time so and so we have actually no time zone

02:16.850 --> 02:20.550
addressed here to our data frame or to our daytime index.

02:20.550 --> 02:27.000
So to say our data frame and our daytime index here time less and that's actually our first step here

02:27.000 --> 02:35.190
we have to localize our daytime index and we can actually do this with the math that tease that localize

02:35.790 --> 02:40.830
and by doing so we actually set as safe a time zone on our daytime index.

02:40.860 --> 02:43.390
And for example we can choose a UTC.

02:43.830 --> 02:48.650
So we know that here our daytime index is based on is done on New York time.

02:48.660 --> 02:53.090
But first of all we can for example localize that to UTC

02:56.030 --> 03:02.420
and still be a fear the day and the time and then we have fear and additional information plus the zero

03:02.420 --> 03:03.750
hours and minutes.

03:03.920 --> 03:10.130
And actually once we have localized our daytime index then here we can see the difference the time offset

03:10.220 --> 03:12.070
to the UTC time.

03:12.260 --> 03:19.880
And if we localize what it takes to UTC then of course the time difference offset is zero.

03:19.880 --> 03:26.840
So now let's localize our daytime index to a New York time and we can do this by passing America New

03:26.840 --> 03:27.290
York

03:30.820 --> 03:33.980
now and still of course we have the same daytime information.

03:33.990 --> 03:40.710
So the twenty ninth of July and the first time the embassy or 10:00 but here we have the additional

03:40.710 --> 03:45.540
information that we are four hours behind the UTC time.

03:45.600 --> 03:46.830
So that's the New York.

03:46.860 --> 03:56.200
Eastern time and do we have 10 a.m. and the corresponding UTC time is actually at 2:00 p.m. or 14 p.m..

03:56.250 --> 04:02.740
All right and actually to save our time zone information we have uh 2 0 0 0 right here.

04:02.760 --> 04:04.210
Our data frame.

04:04.380 --> 04:11.920
So we have to reassign it here to the variability.

04:12.120 --> 04:18.780
So here we have on the left hand side the localized daytime index and in the next video we will see

04:18.780 --> 04:26.220
how to convert a localized the daytime index to another time slow and soft like cyber to L.A..

04:26.550 --> 04:31.710
So for example we can get to the L.A. Time corresponding to the New York time.

04:31.800 --> 04:35.530
So thanks for watching and I'll see you also on the next video.

04:35.600 --> 04:35.880
By.
