Javascript MomentJs给出了错误的月份
给出了错误的月份Javascript MomentJs给出了错误的月份,javascript,angular,time,ionic2,momentjs,Javascript,Angular,Time,Ionic2,Momentjs,给出了错误的月份 const time = moment("2300","hhmm").format("HH:mm"); const weekDay = moment().weekday(2).format("DD/MM/YYYY"); const notification = moment(weekDay + " " + time, "DD/HH/YYYY HH:mm");
const time = moment("2300","hhmm").format("HH:mm");
const weekDay = moment().weekday(2).format("DD/MM/YYYY");
const notification = moment(weekDay + " " + time, "DD/HH/YYYY HH:mm");
console.log(notification);
给出:
哪个不正确?应该是2018年10月30日星期二23:00:00 GMT\U 0200(EET)
我不明白为什么一月会出现
力矩版本:^2.1.0
您的解析格式似乎有错误
const notification=时刻(工作日+“”+时间,日/时/年:时)代码>
应该是
const notification=时刻(工作日+“”+时间,日/月/年:时)代码>您的解析格式似乎有错误
const notification=时刻(工作日+“”+时间,日/时/年:时)代码>
应该是
const notification=时刻(工作日+“”+时间,日/月/年:时)代码>可能与此相关,请检查您的\u f
格式字符串;您有一个HH
月份应该在哪里,它是MM
可能与此检查相关的\u f
格式字符串;您有一个HH
月的位置,即MM
Object
_a: [2018, 0, 30, 23, 0, 0, 0] (7)
_d: Tue Jan 30 2018 23:00:00 GMT+0200 (EET)
_f: "DD/HH/YYYY HH:mm"
_i: "30/10/2018 23:00"
_isUTC: false
_l: undefined