AGE_CALCULATOR / app.py
safiaa02's picture
Create app.py
96912c4 verified
raw
history blame contribute delete
737 Bytes
import streamlit as st
from datetime import date
st.set_page_config(page_title="Age Calculator", page_icon="๐Ÿ“…")
st.title("๐Ÿ“… Age Calculator")
st.write("Enter your birthdate to find your age in **years, months, and days**.")
birth_date = st.date_input("Select your birthdate:", min_value=date(1900, 1, 1), max_value=date.today())
if birth_date:
today = date.today()
delta = today - birth_date
years = delta.days // 365
months = (delta.days % 365) // 30
days = (delta.days % 365) % 30
st.subheader("๐Ÿงฎ Your Age is:")
st.markdown(f"**{years}** years, **{months}** months, **{days}** days")
st.markdown("---")
st.caption("Made with โค๏ธ using Streamlit | Deployed on Hugging Face Spaces")