Build an Advanced Age Calculator in Python Using Day of Birth, Next Birthday & More
118 views
Jun 3, 2025
Get the full source code of application here:
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you a
0:04
Python package which will return your
0:06
age inside uh multiple formats it will
0:09
return your age inside months weeks
0:13
total number of days how much you lived
0:15
on this earth how much hours how much
0:18
minutes so there is a Python package in
0:21
which you can build out this advanced
0:23
age calculator you just need the date of
0:25
birth and this is actually the package
0:28
name here age calculator so it actually
0:32
calculates your birth information based
0:34
upon a specified date of birth the
0:37
command is very simple you simply
0:38
install this uh package right here i've
0:42
already installed it so after
0:45
installing this is actually we are
0:47
providing the date of birth right here
0:48
to this package right here you will see
0:51
after that let me run this Python script
0:53
and show to
0:56
you so as I run the script here you will
0:58
see it will return the data in various
1:01
formats we just provided the date of
1:03
birth and then it calculates the age you
1:06
can see age in number of days number of
1:09
hours months weeks age in weeks dates
1:14
you will see year
1:16
months date of birth which is you can
1:20
see it will return the day day since
1:23
last birthday days until next birthday
1:25
you will see so this advanc data it will
1:29
return by just the date of birth so it's
1:31
a very useful package if you are
1:33
building some kind of a age calculator
1:35
web application you can use this free
1:37
package so let me show you how to get
1:40
started it's very simple you first of
1:42
all require this
1:43
package let me show you the full
1:49
script so you simply require the package
1:52
at the very top which is age calculator
1:54
after importing
1:56
it you just need to provide your date of
1:59
birth to this package so age calculator
2:02
and it contains this function age
2:04
calculator and specifically provide the
2:07
age date of birth right here this is a
2:10
format 11th is the day 1 is the month
2:14
1997 is the year so you provide this
2:17
date of birth and after that it will
2:19
calculate everything let's
2:22
suppose we want to calculate the age
2:26
from this so age in
2:29
years so this will say do ob
2:34
similarly if you want to print out the
2:37
age in weeks months days um hours so it
2:42
will have all these parameters
2:46
attributes then we can also get the age
2:48
in number of weeks
2:51
months you can
2:56
see so if I just execute this you will
3:00
see that it will return everything the
3:04
age so if you're building some kind of a
3:07
age calculator this package will be very
3:10
much and once again it has more
3:13
functions related to
3:16
age so you can do that as well so you
3:19
can see you can have a specific date and
3:22
then calculate the age from that
3:25
specific date as well so in this
3:28
way you can use this package to
3:31
calculate the age calculator and build
3:33
out advanced age calculator in the
3:35
terminal so the command simple simply
3:38
execute the command to install this and
3:41
then you can safely use this module
3:43
inside the python script so thank you
3:45
very much for watching this video and
3:47
also check out my uh website
3:49
freemediattools.com
3:52
uh which contains thousands of tools