WEBVTT

00:04.030 --> 00:04.420
Okay.

00:04.720 --> 00:09.700
Hey, that everyone had their share and let's go ahead and handle the date situation that we have now.

00:09.700 --> 00:12.540
The date situation that we got right now is just by saying date.

00:12.790 --> 00:15.910
Now, this was kind of a basic way of getting through it.

00:15.910 --> 00:19.230
And when I say just send on this one, it gives me a number.

00:19.240 --> 00:22.930
Surely this number can be further converted into an actual date.

00:22.930 --> 00:26.950
But what about something different, something much more readable?

00:26.950 --> 00:31.870
We can also use the constructor of this and we can see New Date something like this.

00:31.870 --> 00:33.070
Let's go ahead and save this one.

00:33.070 --> 00:35.140
Let's see what kind of response does it get?

00:35.230 --> 00:40.900
And we get the date, which is much more in the readable format, but still not exactly that I want

00:40.900 --> 00:41.170
it to be.

00:41.170 --> 00:42.700
I want more control on that.

00:42.730 --> 00:47.800
Now, definitely there are local string that can convert your date, but handling with them sometimes

00:47.800 --> 00:51.880
can be overwhelming and they just provide you limited options.

00:51.880 --> 00:56.740
Sometimes you need a little bit more than that whenever the situation comes it when we need a lot more

00:56.770 --> 00:59.680
than this, that's where the NPM comes in.

00:59.710 --> 01:01.540
Now, this is a central repository.

01:01.540 --> 01:02.680
We are going to see everything.

01:02.680 --> 01:07.750
Whenever you say NPM, install something, this is where from things are actually coming in, including

01:07.750 --> 01:08.680
your express.

01:08.770 --> 01:13.720
And whenever you try to study something about date and all of this, the first package that you are

01:13.720 --> 01:19.960
going to see in all of the blogs and articles and YouTube video is this one moment.

01:19.990 --> 01:24.700
The moment is one of the classiest and all time amazing project.

01:24.700 --> 01:26.460
You'll see this for a reason.

01:26.470 --> 01:28.600
Notice here the number of weekly downloads.

01:28.600 --> 01:29.770
This is crazy.

01:29.770 --> 01:34.270
But what a lot of people miss that this is written here in the very bold line.

01:34.270 --> 01:36.040
Not bold, but yet it is written up here.

01:36.070 --> 01:36.640
That moment.

01:36.660 --> 01:39.610
JS is a legacy project now in maintenance mode.

01:39.610 --> 01:42.040
In most cases you should choose a different library.

01:42.040 --> 01:44.860
So they have openly mentioned that this is a legacy project.

01:44.860 --> 01:49.930
Still, everybody is using it simply because there are not much of enough tutorial who actually teaches

01:49.930 --> 01:54.280
to read the documentation properly and use some of the new libraries which are coming in.

01:54.280 --> 01:56.890
Remember moment was also new at one point.

01:57.040 --> 02:01.990
So if I go ahead and look for something on the date, probably if I'll read more on the StackOverflow

02:01.990 --> 02:04.690
or some similar website, I'll find more of the details.

02:04.690 --> 02:10.000
But if I look for the date, you can see there is a whole lot of date packages being available up here.

02:10.000 --> 02:14.580
One of them available here, which is getting recent popularity, is the date format.

02:15.040 --> 02:20.470
Now, this package is very, very lightweight and this is probably not the one I'm looking for.

02:20.470 --> 02:22.780
So this is the date dash format.

02:22.780 --> 02:24.220
This is what I'm looking for.

02:24.310 --> 02:26.350
So this is really getting popular.

02:26.350 --> 02:27.760
Weekly downloads are pretty high.

02:27.760 --> 02:30.490
It is very lightweight, 19 kbps only.

02:30.490 --> 02:33.490
And that's the reason why I absolutely love this one.

02:33.610 --> 02:36.310
All you got to do is kind of similar with the Express.

02:36.310 --> 02:37.390
We have to install it.

02:37.420 --> 02:44.260
We have to simply say format as a string, pass on the new date and then we can use the format to format

02:44.260 --> 02:44.770
the date.

02:44.770 --> 02:46.810
Pretty simple documentation, isn't it?

02:46.810 --> 02:51.340
Let's go ahead and use this copy button to go back onto where V is code.

02:51.340 --> 02:54.280
And this is the very first time we are using a third party library.

02:54.280 --> 02:59.050
So let's go ahead and say I want to install you pretty lightweight, simple, keep our server up and

02:59.050 --> 02:59.650
running.

02:59.710 --> 03:03.670
Check just for the validation that yes, this is being installed.

03:03.760 --> 03:09.580
How we're going to use this just as mentioned in the documentation, create a format, feel free to

03:09.580 --> 03:12.310
name it anything and then simply require it.

03:12.310 --> 03:14.410
Use it as as a string.

03:14.440 --> 03:15.130
Sounds easy.

03:15.130 --> 03:16.420
Let's go ahead and give it a try.

03:16.720 --> 03:18.010
Let's go ahead and come up here.

03:18.010 --> 03:24.250
We're going to simply say const format and then we are going to go ahead and say, I want to require

03:24.250 --> 03:24.730
it.

03:25.180 --> 03:27.070
And this one was date format.

03:27.100 --> 03:32.920
Now I can use this format so I can go ahead and remove this one and I can say format.

03:34.910 --> 03:36.890
And dart as a string.

03:36.890 --> 03:39.530
And here I can first pass on the format.

03:39.530 --> 03:44.460
And once I'm done with the format, I can just go ahead and pass on a new date, just like as mentioned.

03:44.480 --> 03:50.090
And here, if I go back into the documentation, I'll see that I definitely can use an hours and minutes

03:50.090 --> 03:50.720
and second.

03:50.720 --> 03:54.110
But here they give you a lot more information that you probably want.

03:54.110 --> 03:59.510
And you can also mention the format that you want to use, like absolute date format or ISO or something

03:59.510 --> 04:00.170
like that.

04:00.260 --> 04:08.810
I'll go for a combination of some hours, some not hours, actually, some dates and some months with

04:08.810 --> 04:11.690
a capital M not here, so I'm not interested in that.

04:11.690 --> 04:13.700
But I'll go for hours, minutes and seconds.

04:13.700 --> 04:15.200
So this is what I'll be going.

04:15.200 --> 04:16.580
Let's go ahead and copy this.

04:16.850 --> 04:17.930
Move back up here.

04:17.930 --> 04:23.000
So in the format, I'll definitely go for our minutes and second, but I would also like to go for the

04:23.000 --> 04:31.910
date and I would also like to for some reason in my case, this is the day that comes in and this is

04:31.910 --> 04:36.230
the month where in the capital that comes in, I don't know, this is a weird syntax, but I decided

04:36.230 --> 04:37.070
to go for this.

04:37.370 --> 04:39.680
You can go ahead and decide to go for a better one.

04:39.680 --> 04:43.190
Let's see if this gives us some problems in the Instagram route.

04:43.190 --> 04:44.330
So this is Instagram.

04:44.330 --> 04:46.520
Send that and notice here beautifully.

04:46.520 --> 04:48.770
11 in the brackets.

04:48.770 --> 04:50.180
This is the ten, this is the month.

04:50.180 --> 04:51.110
And this is here.

04:51.110 --> 04:53.360
Beautiful time that is coming in.

04:53.510 --> 04:54.710
This is just an example.

04:54.710 --> 04:56.540
Feel free to just play around more with that.

04:56.540 --> 05:00.050
But the date problem is being solved, so I'm going to go ahead and copy this.

05:00.620 --> 05:05.450
Definitely copying is not a great idea and putting that in everyone I would probably create available

05:05.450 --> 05:06.080
for that.

05:06.080 --> 05:10.610
But hey, we'll talk about them later on and I'm not going to do that on LinkedIn.

05:10.730 --> 05:13.100
You need to do it for LinkedIn, but in a different format.

05:13.100 --> 05:14.750
That's going to be an assignment for you.

05:14.870 --> 05:17.750
So let's go ahead and see this one works fine.

05:17.750 --> 05:18.680
Yeah, that's good.

05:19.640 --> 05:23.870
So this is the first time he learned that how we can install some third party packages, can read their

05:23.870 --> 05:26.150
documentation and implement them in the project.

05:26.150 --> 05:27.560
That's how everything goes on.

05:27.560 --> 05:32.810
Sometime it is that easy that you have just a few lines of documentation, but sometimes you get the

05:32.810 --> 05:33.260
idea.

05:34.580 --> 05:39.050
So as an assignment, go ahead and change the LinkedIn date and make sure you do something different,

05:39.050 --> 05:43.160
not like me and click a photo tag on Instagram and I'll wait for that.

05:43.160 --> 05:45.590
Let's go ahead and catch up in the next video.
