1 00:00:01,980 --> 00:00:08,300 OK, here we are and where else are starting the program, so let's just try a few things with dates. 2 00:00:09,510 --> 00:00:21,840 So let's take a couple of examples from the slide and I'll say let day one equals new date one, slash 3 00:00:21,840 --> 00:00:23,370 one, slash twenty twenty two. 4 00:00:25,710 --> 00:00:30,930 And as you can probably guess, one slash, one slash twenty twenty two is local specific. 5 00:00:31,650 --> 00:00:35,100 So it may run differently depending upon the locale. 6 00:00:36,630 --> 00:00:42,360 So if you really want to be specific, you probably want to put it in more of a standard format like 7 00:00:42,360 --> 00:00:51,570 twenty twenty two, dash one, dash one, and then we can do the same sort of thing and say let the 8 00:00:51,570 --> 00:00:56,970 two equals a new date. 9 00:00:58,260 --> 00:00:59,760 Twenty, twenty two. 10 00:01:01,860 --> 00:01:11,220 We'll say oh two, we'll tell it, we'll just say two and 15 again. 11 00:01:11,220 --> 00:01:14,730 You might think that this is going to be February 15th, but it's really March 15th. 12 00:01:16,890 --> 00:01:19,140 So I'll put these and see what we got. 13 00:01:20,280 --> 00:01:26,460 So I'm going to say council that log date one and I'm going to type update one. 14 00:01:30,060 --> 00:01:35,100 And let's just copy this and do the same thing for day two. 15 00:01:42,940 --> 00:01:43,840 So let's run that. 16 00:01:49,540 --> 00:01:59,110 So run hello, world, and we'll get December 31st, 2021, 1900, GMT minus five, so we specified 17 00:01:59,110 --> 00:02:04,630 20, 22, 101, but it took that to mean UTC date. 18 00:02:05,530 --> 00:02:07,330 So subtract the five hours from it. 19 00:02:08,530 --> 00:02:12,340 And then 2022 to 15 two is really March, as I said. 20 00:02:13,300 --> 00:02:18,420 So it took that to mean the local time for this particular constructor. 21 00:02:18,940 --> 00:02:24,780 So you can see that it's saying that it's March 15th at midnight GMT minus four hundred. 22 00:02:25,750 --> 00:02:32,050 So if we converted that back to UTC time, that would be March 16th at 4:00 in the morning. 23 00:02:34,140 --> 00:02:40,470 Now, there's some two methods, like two string methods to let us output this in a little bit more 24 00:02:40,470 --> 00:02:48,390 of a format so I can say cancel that log date one. 25 00:02:50,220 --> 00:02:56,910 And there's there's two date string, which just outputs the date part to time string, which just outputs 26 00:02:56,910 --> 00:02:57,920 the time part. 27 00:02:58,670 --> 00:03:05,000 There's a local string which outputs it for your particular locale, your your area or geographic location. 28 00:03:05,700 --> 00:03:06,840 So let's make use of that. 29 00:03:18,350 --> 00:03:27,650 And you can see here, I put it, using United States format 12, 31, 20, 21, 7:00 p.m. So the United 30 00:03:27,650 --> 00:03:32,330 States program are used for a 12 hour time. 31 00:03:33,380 --> 00:03:39,710 So converted it from the nineteen hundred to the seven p.m. and you can see that it's five hours before 32 00:03:40,070 --> 00:03:41,100 what we specified. 33 00:03:41,630 --> 00:03:47,890 So what this tells us is that what we specified up here in the new date gives us a standard time format. 34 00:03:47,900 --> 00:03:51,170 So it's at that Greenwich Mean Time or that UTC time. 35 00:03:54,950 --> 00:03:56,480 So let's do a couple of methods. 36 00:03:58,460 --> 00:04:00,050 So, for example, I can say 37 00:04:05,240 --> 00:04:10,670 date one that get month, because this is the confusing one. 38 00:04:12,410 --> 00:04:13,430 So what's up with that? 39 00:04:17,280 --> 00:04:26,580 And day one is the January one, but remember, it came out in December and our local time, so it's 40 00:04:26,580 --> 00:04:28,590 comes out as 11, which is December. 41 00:04:30,990 --> 00:04:36,690 And same thing, if we do the get here, it's going to be the wrong year because of the time conversion. 42 00:04:38,580 --> 00:04:46,240 And all of this is what makes the dates in general when kept for years confusing. 43 00:04:47,580 --> 00:04:50,250 And again, I would highly recommend that you look at moment. 44 00:04:50,440 --> 00:04:50,810 Yes. 45 00:04:50,820 --> 00:04:53,880 Or another JavaScript library to help with those. 46 00:04:59,070 --> 00:05:07,160 So even though we made it in 2022 because it got pulled back to December because of the time zone is 47 00:05:07,170 --> 00:05:07,920 20 21. 48 00:05:10,890 --> 00:05:15,060 All right, so that is all I'm going to do with dates for right now, we'll probably use a couple examples 49 00:05:15,060 --> 00:05:22,680 as we move forward and I'll put a link to the moment that G.S. website for you to look at in the notes.