Skip to content
πŸ› οΈToolsShed

Next Birthday Calculator

Calculate days until your next birthday, current age, and day of the week.

About this tool

Birthdays are milestones we celebrate each year, but tracking the exact number of days remaining until your next one can be surprisingly useful for planning special occasions, sending reminders to loved ones, or simply satisfying your curiosity about how far away your next celebration is. This Next Birthday Calculator instantly computes how many days are left until your next birthday, shows you your current age, and even reveals what day of the week your birthday will fall on, all based on your birth date and today's date.

Using the tool is straightforward: enter your date of birth, and it immediately displays the countdown in days, your exact age in years, and the day name for your upcoming birthday. This works for anyone regardless of when their birthday is, whether it's months away or just a few weeks, making it perfect for planning surprise parties, scheduling birthday-related events, or setting up advance notifications.

Frequently Asked Questions

Code Implementation

from datetime import date

def next_birthday_info(birth_date: date, today: date = None) -> dict:
    """Calculate days until next birthday, current age, and day of week."""
    if today is None:
        today = date.today()

    age = today.year - birth_date.year
    # Check if birthday already happened this year
    had_birthday = (today.month, today.day) >= (birth_date.month, birth_date.day)
    if not had_birthday:
        age -= 1

    # Next birthday
    next_year = today.year if not had_birthday else today.year + 1
    try:
        next_bday = date(next_year, birth_date.month, birth_date.day)
    except ValueError:  # Feb 29 on non-leap year
        next_bday = date(next_year, 3, 1)

    days_until = (next_bday - today).days
    day_of_week = next_bday.strftime("%A")

    return {
        "current_age": age,
        "next_birthday": next_bday.isoformat(),
        "days_until": days_until,
        "day_of_week": day_of_week,
        "is_today": days_until == 0,
    }

info = next_birthday_info(date(1990, 7, 15))
print(f"Age: {info['current_age']}")
print(f"Next birthday: {info['next_birthday']} ({info['day_of_week']})")
print(f"Days until: {info['days_until']}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.