Reina Madre

ginecologos CDMX (55) 8526 6020     (722) 709 8956

function comparacion (){ var fecha_aux = document.getElementById("fecha").value.split('/') var m = new Date(fecha_aux) var x = Date.now() var day_as_milliseconds = 86400000; var diff_in_millisenconds = x - m; var diff_in_days = diff_in_millisenconds / day_as_milliseconds; valor = Math.trunc(diff_in_days); if(valor>=7){ semanas=valor/7; valor_semanas = Math.trunc(semanas); alert('tienes '+ valor_semanas +' semanas de embarazo') } else{ alert('tienes '+ valor +' dias de embarazo') } }
PHP Code Snippets Powered By : XYZScripts.com