Date of birth calculator
DATE OF BIRTH CALCULATOR:-
This calculator is different from the other
Because this calculator include in your date of birth and month,week, hours, minutes also calculated.
This code was created python
from datetime import datetime
dob = input("Enter your date of birth (YYYY-MM-DD): ")
dob = datetime.strptime(dob, '%Y-%m-%d')
current_date = datetime.now()
age = current_date - dob
years = int(age.days / 365.25)
months = int((age.days % 365.25) / 30.4375)
days = age.days % 365.25 % 30.4375
hours = age.seconds // 3600
minutes = age.seconds % 3600 // 60
print(f"You are {years} years, {months} months, {int(days)} days, {hours} hours, and {minutes} minutes old.")
Comments
Post a Comment