WEBVTT 00:00:09.150 --> 00:00:15.250 OK now let's see how we can convert at times time to time. 00:00:15.450 --> 00:00:16.230 OK. 00:00:16.770 --> 00:00:24.670 So we're going to go from the abuse of format to a readable format that we can read. 00:00:24.690 --> 00:00:25.080 OK. 00:00:25.260 --> 00:00:29.060 So let's write some place code in that 00:00:31.830 --> 00:00:35.050 . 00:00:35.770 --> 00:00:36.390 OK. 00:00:36.510 --> 00:00:41.370 And now we're going to create another variable. 00:00:41.370 --> 00:00:55.320 We're going to call it time and this time we are going to convert this timestamp OK to a date or date 00:00:55.360 --> 00:00:56.120 and time. 00:00:56.490 --> 00:01:01.710 So you got to use the Date function and this time we're going to use both arguments. 00:01:01.740 --> 00:01:08.360 So the first arguments as we have seen is the formats and the second one is going to be the time. 00:01:08.460 --> 00:01:10.950 And let's use this variable. 00:01:11.980 --> 00:01:16.790 Ok so let's choose our format. 00:01:17.130 --> 00:01:18.300 OK. 00:01:18.420 --> 00:01:20.520 So going to go for 00:01:24.340 --> 00:01:31.790 space small the capital Y. 00:01:33.180 --> 00:01:34.800 And then for the time let's have 00:01:38.350 --> 00:01:42.790 a second on the capital A. 00:01:43.400 --> 00:01:45.360 Ok or was married. 00:01:45.630 --> 00:01:51.520 OK so now if I save and refresh. 00:01:52.800 --> 00:01:55.160 OK let's go. 00:01:55.660 --> 00:01:56.430 It's all. 00:01:56.440 --> 00:01:59.010 So we're going to echo a paragraph 00:01:59.660 --> 00:02:05.920 . 00:02:05.950 --> 00:02:08.150 Time is 00:02:13.900 --> 00:02:15.970 a variable time 00:02:17.030 --> 00:02:20.750 . 00:02:23.320 --> 00:02:24.030 OK. 00:02:24.270 --> 00:02:26.190 So let's refresh now. 00:02:26.820 --> 00:02:34.310 OK so you can see now that the time is June so I've used the capital F for the full month. 00:02:35.220 --> 00:02:38.840 Probably wouldn't There's one in there. 00:02:39.510 --> 00:02:45.410 OK so capital F is used for the full month actually 00:02:46.660 --> 00:02:50.600 . 00:02:53.340 --> 00:02:57.390 OK. 00:02:57.390 --> 00:03:04.970 So you can see that we have converted this timestamp to a readable formats of the time. 00:03:05.430 --> 00:03:07.880 Okay. 00:03:09.450 --> 00:03:13.360 So the date function if it takes to promise is the formats of that time. 00:03:13.380 --> 00:03:18.160 So we'll just take the time stamp and convert it to this format. 00:03:18.360 --> 00:03:19.040 Okay. 00:03:19.110 --> 00:03:24.060 And if we refresh the page again you see that's going to change. 00:03:24.060 --> 00:03:25.020 Okay. 00:03:25.140 --> 00:03:27.140 Same service changed. 00:03:27.340 --> 00:03:30.280 The time has changed as well. 00:03:31.190 --> 00:03:34.230 Okay. 00:03:34.290 --> 00:03:40.290 All right so now we going to do something different or are we going to convert a time to a timestamp 00:03:40.300 --> 00:03:40.480 . 00:03:40.670 --> 00:03:41.110 Okay. 00:03:41.240 --> 00:03:43.280 And I'm going to use a new function. 00:03:43.330 --> 00:03:45.690 It's the function call makes. 00:03:46.260 --> 00:03:47.620 All right. 00:03:48.690 --> 00:03:49.200 So 00:03:53.430 --> 00:04:02.030 let's set the timestamp is creates the BHB tag. 00:04:04.950 --> 00:04:05.190 OK. 00:04:05.190 --> 00:04:17.060 So we're going to set the timestamp this time to the outputs of this function make time. 00:04:17.520 --> 00:04:22.610 And if you do control k you can see details about this function. 00:04:22.650 --> 00:04:26.530 So you just gets the Unix timestamp for a date. 00:04:26.760 --> 00:04:35.500 OK so we're going to give it us but I is going to give its first the hour. 00:04:35.760 --> 00:04:38.140 OK minutes. 00:04:38.450 --> 00:04:39.480 So we'll see. 00:04:39.480 --> 00:04:40.910 In our example anyway. 00:04:41.250 --> 00:04:41.740 So 00:04:47.330 --> 00:04:52.860 you just put the comments how this function works so it's going to be make time. 00:04:53.010 --> 00:04:53.740 OK. 00:04:53.770 --> 00:04:59.430 And inside is going to have the hour first minutes. 00:04:59.670 --> 00:05:05.760 Second Month Day. 00:05:07.170 --> 00:05:10.660 OK so let's try something. 00:05:10.700 --> 00:05:21.390 So it is go for the 15th case over the hour 15 for example 20 00:05:23.860 --> 00:05:24.930 12 second 00:05:32.080 --> 00:05:47.300 OK and let's have the month scope for me and October for example. 00:05:47.860 --> 00:05:52.110 Thousand seventeen resolve. 00:05:52.570 --> 00:05:52.820 OK 00:05:52.850 --> 00:06:00.010 . 00:06:00.550 --> 00:06:06.310 So now we can echo this time. 00:06:06.680 --> 00:06:06.920 OK 00:06:22.140 --> 00:06:24.860 in here. 00:06:25.480 --> 00:06:26.490 OK sorry. 00:06:26.710 --> 00:06:31.930 I created the code in the wrong place needs to be in the end of the previous head. 00:06:32.340 --> 00:06:33.760 OK. 00:06:34.140 --> 00:06:39.260 All right so now we're going to see the new timestamp. 00:06:40.080 --> 00:06:42.160 OK. 00:06:43.780 --> 00:06:50.930 And if you want to get the dates and time corresponding to this timestamp. 00:06:51.270 --> 00:06:53.070 OK. 00:06:53.620 --> 00:06:55.360 We're going to do. 00:06:55.720 --> 00:07:00.610 We're going to set the variable time two dates 00:07:03.160 --> 00:07:06.490 and we're going to use this time in the second 00:07:09.160 --> 00:07:10.190 parameter. 00:07:10.510 --> 00:07:12.340 Let's choose the formats we want. 00:07:12.690 --> 00:07:21.220 OK let's go for the same performance that we have used there and then we can see the corresponding dates 00:07:21.310 --> 00:07:24.770 and time for that Times that list accurate. 00:07:24.800 --> 00:07:25.360 Sorry. 00:07:25.620 --> 00:07:26.920 So echo and say 00:07:30.610 --> 00:07:35.080 time will be we know it's going to be in 2017. 00:07:35.380 --> 00:07:36.740 So now. 00:07:37.210 --> 00:07:37.470 OK. 00:07:37.480 --> 00:07:40.860 So you can see what the time is going to be for this time. 00:07:41.020 --> 00:07:45.930 So you can see it's going to be this and that's OK. 00:07:46.620 --> 00:07:53.260 So that's how we can convert time to a time. 00:07:53.380 --> 00:07:54.010 OK. 00:07:54.300 --> 00:08:03.220 And also gets the time from the timestamp. 00:08:05.680 --> 00:08:08.340 OK now let's do a nice application. 00:08:08.490 --> 00:08:14.140 Let's find out what day of the week somebody was one. 00:08:14.290 --> 00:08:15.070 OK. 00:08:15.490 --> 00:08:25.360 So we're going to have we're going to go from the birth date to convert that to the day of the week 00:08:25.370 --> 00:08:25.530 . 00:08:25.660 --> 00:08:26.460 OK. 00:08:26.530 --> 00:08:33.540 So to do this first OK let's have our PSP tag. 00:08:34.140 --> 00:08:35.240 OK. 00:08:35.260 --> 00:08:44.010 And then we are going to convert the dates to a time stamp. 00:08:44.020 --> 00:08:44.550 OK. 00:08:44.650 --> 00:08:46.390 So we're going to set the same sum 00:08:49.180 --> 00:08:55.040 to the output of the function make slime. 00:08:55.260 --> 00:08:55.550 OK. 00:08:55.570 --> 00:09:04.150 Because we've got the dates and we want to convert that to timestep so we don't have to input all the 00:09:04.660 --> 00:09:06.070 parameters. 00:09:06.690 --> 00:09:09.730 OK we don't have to. 00:09:09.730 --> 00:09:15.710 So for example if we place if we sets out to zero. 00:09:15.790 --> 00:09:16.540 I mean it is zero. 00:09:16.580 --> 00:09:18.040 Second to zero. 00:09:18.600 --> 00:09:22.350 OK. 00:09:23.080 --> 00:09:26.980 We can only say it's the promises of the day. 00:09:27.160 --> 00:09:30.880 We can say for example 15th of April 00:09:34.390 --> 00:09:37.490 19 77 for example. 00:09:37.740 --> 00:09:39.620 OK. 00:09:39.670 --> 00:09:49.540 And now we're going to set the variable time to the outputs of dates which will take the four months 00:09:49.540 --> 00:09:53.580 we want and the time stamp. 00:09:54.760 --> 00:09:55.390 OK. 00:09:55.390 --> 00:10:00.300 So since we want only the day of the week we are just going to rise. 00:10:00.310 --> 00:10:06.420 For example small L for the day of the week. 00:10:06.660 --> 00:10:07.630 OK. 00:10:07.970 --> 00:10:16.270 So what else is going to give us the the full text of the day. 00:10:16.330 --> 00:10:17.720 All right. 00:10:18.700 --> 00:10:23.320 OK so now let's echo a paragraph and say 00:10:29.480 --> 00:10:34.010 you were born on a. 00:10:34.750 --> 00:10:44.080 And we just add the variable time that is let's try this and refresh the page you were born on a Saturday 00:10:44.350 --> 00:10:50.950 so you can see what this data corresponds to Saturday. 00:10:51.030 --> 00:10:53.190 All right. 00:10:55.100 --> 00:11:00.820 Right now let's move to our final example so you want to know the dates in 1000 days from now. 00:11:01.440 --> 00:11:07.330 So what we're going to do we're going to get the time stamp for that date and then we are going to convert 00:11:07.340 --> 00:11:09.680 that to a readable format for us. 00:11:10.000 --> 00:11:10.450 OK. 00:11:10.660 --> 00:11:15.370 So let's set the time timestamp 00:11:23.260 --> 00:11:38.200 using the make time function so we can have zero for the hour than zero then zero. 00:11:39.230 --> 00:11:45.250 OK so now we're going to have the month day and the year. 00:11:45.490 --> 00:11:45.990 OK. 00:11:46.250 --> 00:11:47.060 So the month 00:11:52.610 --> 00:11:58.760 we are going to say that too we're going to head to today's month. 00:11:58.990 --> 00:11:59.590 OK. 00:11:59.650 --> 00:12:04.450 And to do that is we going to use the Date function and for the 00:12:08.130 --> 00:12:11.390 format we're going to have the month only. 00:12:11.940 --> 00:12:12.960 OK. 00:12:13.000 --> 00:12:18.160 So this is going to return the month only. 00:12:18.620 --> 00:12:20.850 Okay. 00:12:21.040 --> 00:12:26.570 And then after that we're going to have the debate. 00:12:26.760 --> 00:12:27.480 OK. 00:12:27.880 --> 00:12:31.990 And this time we're going to have today's day 00:12:34.800 --> 00:12:36.100 using D. 00:12:36.550 --> 00:12:38.800 But we're going to add 1000 to that. 00:12:39.040 --> 00:12:42.540 And that page is going to do all the calculations for us. 00:12:42.590 --> 00:12:44.070 OK. 00:12:44.300 --> 00:12:49.260 Who gets the least timestamp of today's date. 00:12:49.420 --> 00:12:51.710 Plus 1000 days. 00:12:51.700 --> 00:12:52.640 OK. 00:12:52.670 --> 00:12:58.040 And the final Brahmin's is going to be a year and a half two days. 00:12:58.070 --> 00:12:59.150 Yes. 00:12:59.290 --> 00:13:01.210 Using Bate's. 00:13:01.250 --> 00:13:02.610 Yes. 00:13:03.590 --> 00:13:05.920 OK. 00:13:05.990 --> 00:13:19.910 So if we do that and then says the time variable to be corresponding dates for that time stamp using 00:13:19.900 --> 00:13:23.900 the dates function pay 00:13:29.150 --> 00:13:34.430 and the time stamp. 00:13:35.000 --> 00:13:36.160 So it go for this for. 00:13:36.160 --> 00:13:46.930 For example capital the space for the capital and comes away with a quote paragraph after that 00:13:53.330 --> 00:14:02.330 saying date in 1000 days from now. 00:14:04.630 --> 00:14:05.150 OK. 00:14:05.290 --> 00:14:14.120 So before we have reached the page you just explain again how this works so when BHB gets today's dates 00:14:14.570 --> 00:14:15.760 plus 1000. 00:14:15.930 --> 00:14:16.390 OK. 00:14:16.660 --> 00:14:20.590 So we know that if we add 1000 days. 00:14:21.250 --> 00:14:30.830 OK if you add 1000 days that means we are adding 1000 times the amount of seconds that's in a day. 00:14:31.030 --> 00:14:33.060 OK so we're going to add 1000. 00:14:33.130 --> 00:14:37.140 Multiplied by how many seconds we have in a day. 00:14:37.730 --> 00:14:38.160 OK. 00:14:38.290 --> 00:14:43.680 And then the time stamp is going to be the time stamp of today. 00:14:43.960 --> 00:14:45.820 OK. 00:14:45.890 --> 00:14:47.530 Because we have two days a month. 00:14:47.530 --> 00:14:54.830 Today's date this year plus 1000 times the amount of seconds in the day. 00:14:54.850 --> 00:14:55.480 OK. 00:14:55.630 --> 00:15:01.840 If we add anything here for the month then we're going to add as well that amount. 00:15:01.880 --> 00:15:07.210 So let's say we are 10 months later we're going to add full time stamp we're going to add 10 times the 00:15:07.210 --> 00:15:10.030 amount of seconds or the number of seconds in a month. 00:15:10.310 --> 00:15:10.820 OK. 00:15:11.020 --> 00:15:14.660 And then we get the final timestamp. 00:15:14.650 --> 00:15:15.540 All right. 00:15:16.070 --> 00:15:25.120 So now we want to get the time stamp corresponding to 1000 days from now. 00:15:25.300 --> 00:15:34.680 So let's refresh the page and we can see OK we haven't added the time variable on the same bible that 00:15:36.580 --> 00:15:43.370 refreshed the page and now we can see that the dates in 1000 days from now is going to be Saturday 24th 00:15:43.490 --> 00:15:45.290 of March 2018 00:15:45.320 --> 00:15:50.830 .