1
00:00:00,680 --> 00:00:06,650
Hi, in this video, you learn how to send an SMS at a particular time every day.

2
00:00:07,520 --> 00:00:13,370
We did already writes that this codes in the previous video, so you have to watch the previous video

3
00:00:13,490 --> 00:00:15,320
in order to understand this one.

4
00:00:16,100 --> 00:00:18,320
So in this section, we have a while loop.

5
00:00:19,620 --> 00:00:25,140
Down here, which periodically executes this, killed every 60 seconds.

6
00:00:25,380 --> 00:00:32,729
Now what are we going to do is we are going to register to recall the current time with details.

7
00:00:32,780 --> 00:00:34,500
Now what is the T.?

8
00:00:34,520 --> 00:00:39,300
Well, that is a class from the datetime library.

9
00:00:39,540 --> 00:00:45,030
So from date time, import date, time s d t, so is that one?

10
00:00:45,570 --> 00:00:51,870
And no, it's a method that gives us the current date and time, which looks like this.

11
00:00:52,080 --> 00:00:55,080
Let me try it quickly here in the interactive shell.

12
00:01:01,940 --> 00:01:04,440
And now will be the current date time.

13
00:01:05,480 --> 00:01:09,080
Then once we have the current date time, we can check.

14
00:01:11,090 --> 00:01:21,680
For example, if the clock at this moment is 13 18, so 1:00 pm 18 minutes, then we're going to execute

15
00:01:22,490 --> 00:01:26,750
this code, so we hear the message and send it out.

16
00:01:27,080 --> 00:01:35,240
And also, this should be indented under the if conditional and the time that sleep method as well,

17
00:01:36,080 --> 00:01:37,520
both time that sleep.

18
00:01:38,570 --> 00:01:39,590
Should stay here.

19
00:01:40,100 --> 00:01:44,720
So what's happening here is that we get the current date time.

20
00:01:44,960 --> 00:01:48,410
We check if that's current daytime is this.

21
00:01:48,830 --> 00:01:51,230
So the time when we want to send the SMS.

22
00:01:51,620 --> 00:01:54,620
And if it is, then we send out of the SMS.

23
00:01:54,980 --> 00:01:57,620
We print out this message that the SMS will send out.

24
00:01:58,070 --> 00:02:01,940
And then what we do is we wait 60 seconds.

25
00:02:02,950 --> 00:02:06,640
And then we execute the, if conditional, one more time.

26
00:02:07,210 --> 00:02:16,900
So basically after every minute, we check the time we check if the current daytime reaches our timestamp

27
00:02:16,900 --> 00:02:19,390
of interest and the loop goes on.

28
00:02:19,780 --> 00:02:20,960
So that's a complete code.

29
00:02:20,980 --> 00:02:23,970
I thank you for calling and lets you in the next few.

