0:00
uh hello guys welcome to this video so
0:02
in this video I will show you a Python
0:05
script which will actually show the
0:07
current date and time
0:10
uh inside the terminal so for this we
0:13
are using the built-in date time package
0:16
so if I execute this command here if I
0:19
execute the script here it will tell the
0:21
exact date and time which is the year
0:24
2025 month 5 day 16 and also tell
0:30
the minute to minute uh this is your 8th
0:34
hour 8th minute 29 second microcond so
0:38
if you want to basically show the
0:40
details like this so I will show you how
0:43
to do this so for this we are using this
0:46
datetime module which is a built-in
0:49
module inside Python you first of all
0:51
import this after that you get the
0:54
current time using this method which is
0:58
contained inside this module which is
1:00
datetime dot datetime dot now this is
1:04
the function which will return the
1:07
time and then we can print
1:21
now so now to get the actual information
1:26
the year information so there it
1:29
basically has all the attributes if I
1:39
this so this current time has all these
1:42
attributes if you see this is actually
1:44
your year this is month this is day this
1:47
is the time here it returns so we
1:51
can extract this so current
1:56
time and it contains this property here
1:59
which is year similarly we can display
2:04
for the month day hour minute everything
2:14
so so you'll see it has all these
2:17
properties here which is your year month
2:21
day hour minute second microcond and
2:24
this is your time zone information and
2:29
so if you execute this now you will see
2:31
it will display all the properties
2:34
separately so using this built-in
2:38
datetime module you can easily display
2:42
the current date and time information
2:44
directly in the terminal so thank you
2:47
very much for watching this video and
2:49
also check out my website
2:54
uh which contains thousands of tools