Hi I wanted to take out the years, months, weeks, days and hours, seconds that have passed since a date. I have achieved what is shown below, but I can not get the exact account, nor can I subtract the time from years, months, weeks, days, etc ... so I always get what happened. I mean the years that have passed, the months that have passed, etc ... and I want the years to come out and the rest of months, days, hours and seconds. (Example: 30 years, 2 months, 1 week, 3 days, 6 hours, 28 minutes, 15 seconds)
var nacimiento = new Date(1936, 11, 29)
var hoy = new Date
var tiempoPasado= new Date() - nacimiento
//calculo segundos
var segundos = tiempoPasado/ 1000
var minutos = segundos / 60
tiempoPasado= tiempoPasado- (minutos - segundos)
var horas = minutos / 60
tiempoPasado= tiempoPasado- ( horas - minutos)
var dias = horas / 24
tiempoPasado= tiempoPasado- (dias - horas)
var meses = dias / 30.416666666666668
tiempoPasado= tiempoPasado- (meses - dias)
var anos = meses / 12
console.log('Han pasado ${anos} años, ${meses} meses, ${dias} dias, ${horas} horas, y ${minutos} minutos desde que naciste. Ya chocheas...!!')