Age Calculator

    Unix Command Equivalent

    Calculate Age with Unix Date

    Use Unix date command to calculate precise age

    birth="YYYY-MM-DD" today=$(date +%s) birth_epoch=$(date -d "$birth" +%s) age_years=$(((today - birth_epoch) / 31536000)) echo "Age: $age_years years"
    Advertisement

    Related Guides & Tutorials

    // developers also read