js根据日期计算年龄
代码:
var birthday=new Date("1989-06-25".replace(/-/g, "\/")); var d=new Date(); var age = d.getFullYear()-birthday.getFullYear()-((d.getMonth()<birthday.getMonth()|| d.getMonth()==birthday.getMonth() && d.getDate()<birthday.getDate())?1:0);