[英]How to convert a date in other format?
I've a date with this format: 我有个这样的约会:
Mon Oct 19 2015 00:00:00 GMT+0200 (ora legale Europa occidentale)
My goal is convert a date into this format: 我的目标是将日期转换为以下格式:
2015-10-19T00:00:00
How I can achieve this result? 我怎样才能达到这个结果?
UPDATE 更新
var currDateEnd = $('#calendar').fullCalendar('getView').start;
currDateEnd.toISOString();
console.log("currDateEnd iso => ", currDateEnd.toDate().toDateString());
this Mon Oct 19 2015 00:00:00 GMT+0200 (ora legale Europa occidentale)
is the String representation of Javascript Date Object , so use this function .toISOString();
此
Mon Oct 19 2015 00:00:00 GMT+0200 (ora legale Europa occidentale)
是JavaScript日期对象的字符串表示形式,因此请使用此函数.toISOString();
like this 像这样
var d = new Date();
$(".yo").append("The String of the object -> "+d.toString()+"<br>");
$(".yo").append("What you want -> "+d.toISOString());
try this 尝试这个
var currDateEnd = $('#calendar').fullCalendar('getView').start;
console.log("currDateEnd iso => ", currDateEnd.toDate().toISOString());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.