[英]Time zone display formatting in Moment.js
I am using moment.js
to get the date from my cordova application. 我正在使用
moment.js
从我的cordova应用程序中获取日期。
expected output 预期产量
2017-06-04T10:17:00+0530 2017-06-04T10:17:00 + 0530
Current output 电流输出
2017-06-04T10:17:00+05:30 2017-06-04T10:17:00 + 05:30
Code 码
var date=moment(enddate).format("YYYY-MM-DDThh:mm:ssZ")
console.log(date);
So how can i get the date as 2017-06-04T10:17:00+0530
this format? 那么如何获取这种格式的日期为
2017-06-04T10:17:00+0530
?
Try ZZ
instead of Z
for the time zone ( from the docs ) 在时区中尝试使用
ZZ
而不是Z
( 来自docs )
var date=moment(enddate).format("YYYY-MM-DDThh:mm:ssZZ")
^
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.