Okay.
Hey, that everyone had their share and let's go ahead and handle the date situation that we have now.
The date situation that we got right now is just by saying date.
Now, this was kind of a basic way of getting through it.
And when I say just send on this one, it gives me a number.
Surely this number can be further converted into an actual date.
But what about something different, something much more readable?
We can also use the constructor of this and we can see New Date something like this.
Let's go ahead and save this one.
Let's see what kind of response does it get?
And we get the date, which is much more in the readable format, but still not exactly that I want
it to be.
I want more control on that.
Now, definitely there are local string that can convert your date, but handling with them sometimes
can be overwhelming and they just provide you limited options.
Sometimes you need a little bit more than that whenever the situation comes it when we need a lot more
than this, that's where the NPM comes in.
Now, this is a central repository.
We are going to see everything.
Whenever you say NPM, install something, this is where from things are actually coming in, including
your express.
And whenever you try to study something about date and all of this, the first package that you are
going to see in all of the blogs and articles and YouTube video is this one moment.
The moment is one of the classiest and all time amazing project.
You'll see this for a reason.
Notice here the number of weekly downloads.
This is crazy.
But what a lot of people miss that this is written here in the very bold line.
Not bold, but yet it is written up here.
That moment.
JS is a legacy project now in maintenance mode.
In most cases you should choose a different library.
So they have openly mentioned that this is a legacy project.
Still, everybody is using it simply because there are not much of enough tutorial who actually teaches
to read the documentation properly and use some of the new libraries which are coming in.
Remember moment was also new at one point.
So if I go ahead and look for something on the date, probably if I'll read more on the StackOverflow
or some similar website, I'll find more of the details.
But if I look for the date, you can see there is a whole lot of date packages being available up here.
One of them available here, which is getting recent popularity, is the date format.
Now, this package is very, very lightweight and this is probably not the one I'm looking for.
So this is the date dash format.
This is what I'm looking for.
So this is really getting popular.
Weekly downloads are pretty high.
It is very lightweight, 19 kbps only.
And that's the reason why I absolutely love this one.
All you got to do is kind of similar with the Express.
We have to install it.
We have to simply say format as a string, pass on the new date and then we can use the format to format
the date.
Pretty simple documentation, isn't it?
Let's go ahead and use this copy button to go back onto where V is code.
And this is the very first time we are using a third party library.
So let's go ahead and say I want to install you pretty lightweight, simple, keep our server up and
running.
Check just for the validation that yes, this is being installed.
How we're going to use this just as mentioned in the documentation, create a format, feel free to
name it anything and then simply require it.
Use it as as a string.
Sounds easy.
Let's go ahead and give it a try.
Let's go ahead and come up here.
We're going to simply say const format and then we are going to go ahead and say, I want to require
it.
And this one was date format.
Now I can use this format so I can go ahead and remove this one and I can say format.
And dart as a string.
And here I can first pass on the format.
And once I'm done with the format, I can just go ahead and pass on a new date, just like as mentioned.
And here, if I go back into the documentation, I'll see that I definitely can use an hours and minutes
and second.
But here they give you a lot more information that you probably want.
And you can also mention the format that you want to use, like absolute date format or ISO or something
like that.
I'll go for a combination of some hours, some not hours, actually, some dates and some months with
a capital M not here, so I'm not interested in that.
But I'll go for hours, minutes and seconds.
So this is what I'll be going.
Let's go ahead and copy this.
Move back up here.
So in the format, I'll definitely go for our minutes and second, but I would also like to go for the
date and I would also like to for some reason in my case, this is the day that comes in and this is
the month where in the capital that comes in, I don't know, this is a weird syntax, but I decided
to go for this.
You can go ahead and decide to go for a better one.
Let's see if this gives us some problems in the Instagram route.
So this is Instagram.
Send that and notice here beautifully.
11 in the brackets.
This is the ten, this is the month.
And this is here.
Beautiful time that is coming in.
This is just an example.
Feel free to just play around more with that.
But the date problem is being solved, so I'm going to go ahead and copy this.
Definitely copying is not a great idea and putting that in everyone I would probably create available
for that.
But hey, we'll talk about them later on and I'm not going to do that on LinkedIn.
You need to do it for LinkedIn, but in a different format.
That's going to be an assignment for you.
So let's go ahead and see this one works fine.
Yeah, that's good.
So this is the first time he learned that how we can install some third party packages, can read their
documentation and implement them in the project.
That's how everything goes on.
Sometime it is that easy that you have just a few lines of documentation, but sometimes you get the
idea.
So as an assignment, go ahead and change the LinkedIn date and make sure you do something different,
not like me and click a photo tag on Instagram and I'll wait for that.
Let's go ahead and catch up in the next video.