WEBVTT 00:03.680 --> 00:06.380 Welcome, I have a new challenge for you. 00:07.010 --> 00:07.700 I ready? 00:08.510 --> 00:09.610 OK, let's take a look. 00:15.750 --> 00:21.720 In his challenge, you're going to create a program that will display the parts of a dynamically by 00:21.720 --> 00:25.600 dynamically, I mean, it will get the current power automatically. 00:26.490 --> 00:28.310 Let me show you how it's going to work. 00:31.560 --> 00:37.650 OK, OK, so if it's the morning time, then your program should print good morning like this. 00:39.140 --> 00:43.370 Or if it's afternoon, it should print good afternoon like this. 00:46.460 --> 00:50.570 Or if it's evening time, then it should print good evening like this. 00:59.780 --> 01:04.400 And lastly, if it's the night time, then it should print good night like this. 01:09.980 --> 01:13.230 To solve this challenge, you need to use the time package. 01:13.790 --> 01:14.450 Let me show you. 01:16.760 --> 01:18.110 Here is the time package. 01:18.550 --> 01:23.990 It allows you to work with the time values, it provides a lot of functionality, is working with time. 01:24.140 --> 01:25.160 You've seen it before. 01:25.160 --> 01:29.120 A lot is my favorite package inside the library. 01:29.570 --> 01:32.900 Anyway, let's take a look at its online documentation. 01:38.670 --> 01:44.230 This is the documentation of the now function of the time package by using this function. 01:44.250 --> 01:50.310 I can learn about the current time, so when I call it, it would return a new time value. 01:51.180 --> 01:51.890 Let's take a look. 01:53.540 --> 02:00.830 Let me scroll down to the time type here, as you can see, it has a lot of methods declared on it since 02:00.830 --> 02:03.520 I will display a message depending on the current hour. 02:03.560 --> 02:06.470 So the one I'm looking for is this our method here? 02:07.560 --> 02:08.810 All right, let's take a look. 02:11.430 --> 02:20.040 It says that our returns the hour within the day specified by tea in the range zero three, this means 02:20.040 --> 02:26.430 that it gets to time from the tea variable here and then it returns a number between zero and 23. 02:28.530 --> 02:31.370 As you can guess, these numbers correspond to ours. 02:31.650 --> 02:31.950 They. 02:33.240 --> 02:38.170 Te variables value will be time that now, so it will contain the currency. 02:38.760 --> 02:44.190 And since our method is declared on the time type, it can return the current hour. 02:45.940 --> 02:49.330 So let me summarize what you've seen from the online documentation. 02:50.250 --> 02:56.850 They call time that now function, it returns the current time as a value with a time type, it's like 02:56.850 --> 03:03.270 returning a new instance of the time type and it initialized the new instance to the current time and 03:03.270 --> 03:05.040 it returns back to as a value. 03:06.200 --> 03:12.230 And as you've seen in the online documentation, the return time value contains a lot of methods for 03:12.230 --> 03:13.250 working with time. 03:14.000 --> 03:15.980 One of them is this Hober Method. 03:16.490 --> 03:19.460 It lets us get the Arber from the time value. 03:20.430 --> 03:25.210 Zero means midnight to 23 means 11 p.m. and so on. 03:26.040 --> 03:30.420 Not that this our method will be called on an instance of a time type. 03:30.970 --> 03:36.000 So it will get the current hour if the time value is created by calling time that now. 03:37.270 --> 03:39.730 What it will return depends on the time value. 03:42.510 --> 03:47.120 All right, to solve this challenge, you should use the other method from the time package. 03:47.270 --> 03:49.890 OK, it returns to Karanth our. 03:50.990 --> 03:57.200 And you should only use a switch statement, preferably you can use a short switch statement. 03:57.440 --> 03:57.890 OK. 03:58.760 --> 03:59.300 All right. 03:59.480 --> 04:00.320 That's our challenge. 04:00.710 --> 04:01.220 Good luck. 04:01.400 --> 04:02.120 Bye for now.