
function getBirthEpoch() {
    var birth = new Date('June 3, 1987 12:30 PM CDT');
    var now = new Date();

    var conv = {
        sec:    1000,
        min:    1000 * 60,
        hour:   1000 * 60 * 60,
        days:   1000 * 60 * 60 * 24,
        months: 1000 * 60 * 60 * 24 * 30.4167,
        year:   1000 * 60 * 60 * 24 * 365.25
    };

    var ms = now - birth;

    var exact = {
        years:  ms / conv.year,
        months: ms / conv.months,
        days:   ms / conv.days,
        hours:  ms / conv.hour,
        min:    ms / conv.min,
        sec:    ms / conv.sec
    };

    var floored = {
        years:  Math.floor(ms / conv.year),
        months: Math.floor(ms / conv.months),
        days:   Math.floor(ms / conv.days),
        hours:  Math.floor(ms / conv.hour),
        min:    Math.floor(ms / conv.min),
        sec:    Math.floor(ms / conv.sec)
    };

    return {
        years: floored.years,
        months: Math.floor((exact.years - floored.years) * 12),
        days: Math.floor((exact.years - floored.years) * 365.25),
        hours: Math.floor((exact.days - floored.days) * 24),
        min: Math.floor((exact.hours - floored.hours) * 60),
        sec: Math.floor((exact.min - floored.min) * 60)
    };
}


function getBirthString() {
    var obj = getBirthEpoch();
    var text = obj.years  + ' ' + (obj.years == 1 ? 'year' : 'years') + ', ' + 
               obj.days   + ' ' + (obj.days == 1 ? 'day' : 'days') + ', ' + 
               obj.hours  + ' ' + (obj.hours == 1 ? 'hour' : 'hours') + ', ' + 
               obj.min    + ' ' + (obj.min == 1 ? 'minute' : 'minutes') + ', and ' + 
               obj.sec    + ' ' + (obj.sec == 1 ? 'second' : 'seconds');
    document.getElementById('birth-epoch').innerHTML = text;
}

setInterval(getBirthString, 1000);
getBirthString();
