OK, here we are and where else are starting the program, so let's just try a few things with dates.
So let's take a couple of examples from the slide and I'll say let day one equals new date one, slash
one, slash twenty twenty two.
And as you can probably guess, one slash, one slash twenty twenty two is local specific.
So it may run differently depending upon the locale.
So if you really want to be specific, you probably want to put it in more of a standard format like
twenty twenty two, dash one, dash one, and then we can do the same sort of thing and say let the
two equals a new date.
Twenty, twenty two.
We'll say oh two, we'll tell it, we'll just say two and 15 again.
You might think that this is going to be February 15th, but it's really March 15th.
So I'll put these and see what we got.
So I'm going to say council that log date one and I'm going to type update one.
And let's just copy this and do the same thing for day two.
So let's run that.
So run hello, world, and we'll get December 31st, 2021, 1900, GMT minus five, so we specified
20, 22, 101, but it took that to mean UTC date.
So subtract the five hours from it.
And then 2022 to 15 two is really March, as I said.
So it took that to mean the local time for this particular constructor.
So you can see that it's saying that it's March 15th at midnight GMT minus four hundred.
So if we converted that back to UTC time, that would be March 16th at 4:00 in the morning.
Now, there's some two methods, like two string methods to let us output this in a little bit more
of a format so I can say cancel that log date one.
And there's there's two date string, which just outputs the date part to time string, which just outputs
the time part.
There's a local string which outputs it for your particular locale, your your area or geographic location.
So let's make use of that.
And you can see here, I put it, using United States format 12, 31, 20, 21, 7:00 p.m. So the United
States program are used for a 12 hour time.
So converted it from the nineteen hundred to the seven p.m. and you can see that it's five hours before
what we specified.
So what this tells us is that what we specified up here in the new date gives us a standard time format.
So it's at that Greenwich Mean Time or that UTC time.
So let's do a couple of methods.
So, for example, I can say
date one that get month, because this is the confusing one.
So what's up with that?
And day one is the January one, but remember, it came out in December and our local time, so it's
comes out as 11, which is December.
And same thing, if we do the get here, it's going to be the wrong year because of the time conversion.
And all of this is what makes the dates in general when kept for years confusing.
And again, I would highly recommend that you look at moment.
Yes.
Or another JavaScript library to help with those.
So even though we made it in 2022 because it got pulled back to December because of the time zone is
20 21.
All right, so that is all I'm going to do with dates for right now, we'll probably use a couple examples
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.