Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript MomentJs给出了错误的月份_Javascript_Angular_Time_Ionic2_Momentjs - Fatal编程技术网

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