0:00
uh hello guys welcome to this video so
0:02
in this video I'll show you a ReactJS
0:04
package which allows you to render uh
0:06
dates and timestamps right inside your
0:09
ReactJS application in different
0:11
formats so you can see it is rendering
0:14
the today's date which is 7th of July
0:16
2000 7th of uh April 2025 it can even uh
0:21
render dates relative to a particular
0:23
date so you can see it is having this
0:26
was 12 years ago so this is actually a
0:29
date specific library for ReactJS
0:31
application and the name of the library
0:34
is React time if you go to npmjs.com
0:37
just search for this package react time
0:40
and it actually renders your uh formats
0:43
your timestamps if you basically want to
0:47
display some kind of complex date you
0:49
can install this package the command is
0:51
very simple it's almost having 1500
0:54
downloads and uh now to get started here
0:57
uh just create a simple functional
1:00
component and after that we simply
1:02
require the package by this import
1:04
statement import require react time so
1:08
you actually import this module using
1:10
this import statement so after you
1:12
require it you simply declare which date
1:15
you want to display so you will get the
1:17
today's date here by using the date
1:20
constructor it will actually store the
1:22
today's date inside this variable and
1:25
then you can even display a date which
1:28
is a past date related to today so let's
1:32
suppose I declare a date here which is
1:34
in the past here so this date can be
1:38
complex here it can be it can include
1:41
the date the current day time you can
1:45
see July 18 2023 this is your time also
1:49
included in different format GMT so now
1:53
if you want to display this inside your
1:55
application what you will
1:57
see so if you want to display today's
2:00
date so you will say today is and then
2:03
you use this component which is time and
2:06
then it actually takes two arguments
2:09
here first of all the value you will
2:11
directly attach the variable here which
2:14
is now and which format so it also
2:18
expects which format you want to display
2:20
the date in so I will provide this
2:22
format year then month then date so this
2:27
is your format here we are providing
2:30
see and then we can even provide uh
2:35
related to it so the past
2:39
date again we provide the value and then
2:42
the title format and here you will
2:44
simply attach this attribute which is
2:46
relative so this is your past date this
2:49
will calculate how many years it is
2:52
passed so now you can see today's date
2:54
is this one and this was 12 years ago so
2:57
if you change let's suppose I say 2009
3:01
so now it will calculate the total
3:03
number of days which is passed so this
3:05
was 16 years ago so this is you can see
3:08
it's a very powerful date timestamp
3:10
library specifically designed for
3:12
ReactJS application so if you basically
3:14
want to display dates and times inside
3:17
your ReactJS application then you can
3:18
use this package here third party
3:21
package the usage is very simple you
3:24
first of all you require this package
3:26
then you declare whichever date that you
3:28
want to display and simply inside your
3:30
JSX you simply use this component
3:32
passing these two parameters first of
3:34
all the value and then the format and
3:38
then you just add relative to it to add
3:40
relative date so this was the package
3:43
here very useful package related to date
3:46
and time inside ReactJS which displays
3:50
formatted timestamps uh thank you very
3:53
much for watching this video and also
3:54
check out my website freemediatools.com
3:57
which contains thousands of tools
3:59
regarding audio video and image