1
00:00:00,300 --> 00:00:05,970
This lesson we're going to be building out the current time value and we can use that with JavaScript,

2
00:00:05,970 --> 00:00:14,580
with the date object, so setting up a temp value for the date, we're using the new date object and

3
00:00:14,580 --> 00:00:17,970
we're also getting the value from that input field.

4
00:00:19,020 --> 00:00:25,470
And as you can see, when I do console log, whatever element triggered off the event, we can use this

5
00:00:25,710 --> 00:00:28,710
and then we can use this value to get that content.

6
00:00:29,040 --> 00:00:32,310
And we've also got it within that input as well.

7
00:00:32,610 --> 00:00:36,130
So we could also do it as end date value as well.

8
00:00:37,260 --> 00:00:40,820
So either one will work and then we're setting up that new date.

9
00:00:40,920 --> 00:00:46,530
We're going to pass that end date value into it and then output that new temp value.

10
00:00:46,560 --> 00:00:48,010
I'll see what that looks like as well.

11
00:00:48,360 --> 00:00:51,500
So it's going to be within our date object.

12
00:00:51,510 --> 00:00:54,700
So a console log out the value of temp as well.

13
00:00:55,080 --> 00:01:00,450
So now whenever I go into this input, I change the value we see.

14
00:01:00,450 --> 00:01:03,420
We get the value that's available within the input field.

15
00:01:03,690 --> 00:01:09,600
But in order to use it in JavaScript and get all of the exact hours, minutes, seconds and so on,

16
00:01:09,810 --> 00:01:12,630
we need to format it within a date object.

17
00:01:12,720 --> 00:01:16,230
And that's going to give us some additional parameters there to work with.

18
00:01:16,440 --> 00:01:20,620
And those are what we need in order to calculate out hours and seconds and so on.

19
00:01:20,970 --> 00:01:27,450
So that's where we're using that date object and that allows us to format it properly and use it within

20
00:01:27,450 --> 00:01:28,820
our calculations.

21
00:01:29,520 --> 00:01:36,740
So now that we've got our temporary date object, we can create a function and we can output the clock.

22
00:01:36,990 --> 00:01:42,510
So start clock and within here we can send through whatever the value of temp is.

23
00:01:42,990 --> 00:01:47,070
So setting up a function to handle that new clock building.

24
00:01:48,640 --> 00:01:52,810
And we'll just call this one D, the value that we're passing to start clock.

25
00:01:53,590 --> 00:01:57,730
So this essentially is our end time that we have to work with.

26
00:01:57,970 --> 00:02:04,600
Now, let's select our content and let's make a calculation about how much time is remaining.

27
00:02:04,840 --> 00:02:07,710
And we need to create a function in order to handle that.

28
00:02:08,200 --> 00:02:10,670
So we're passing in the value D.

29
00:02:11,140 --> 00:02:13,570
And coming up next, I'll show you how we can handle that.

30
00:02:13,810 --> 00:02:16,870
So we need to do a calculation of time left.

31
00:02:17,880 --> 00:02:22,900
And passing in that time once again, and we'll set that function up in the upcoming lesson.

32
00:02:23,280 --> 00:02:27,070
So for now, create a new function to handle the starting of the clock.

33
00:02:27,090 --> 00:02:31,830
And this is where we're going to set up and we're going to also update the output there that's visible

34
00:02:31,830 --> 00:02:32,840
to the user.

35
00:02:33,300 --> 00:02:34,790
So all of that is still yet to come.
