如果输入的是多少岁要计算这个人的出生日期
moment().subtract(9, 'years')
如果输是按月计算,当为日期和月份传入小数时,它们会被四舍五入到最接近的整数。 星期、季度、年份会被转换到日期或月份,然后四舍五入到最接近的整数。
moment().subtract(1.5, 'months') == moment().subtract(2, 'months')
按天计算
moment().subtract(7, 'days');
这是我写的一个简单demo
const moment = require('moment');
let Patientbirthyear = req.body.Patientbirthyear;
Patientbirthyear1