http://jsfiddle.net/skowron_line/zPCBc/1/
var d1 = '31.05.2012';
var d2 = '01.06.2012';
var s1 = d1.split('.');
var s2 = d2.split('.');
var nd1 = new Date(s1[2], s1[1], s1[0]);
var nd2 = new Date(s2[2], s2[1], s2[0]);
$('#a').html(s1 + ' - '+ s2 +' = '+ nd2.getTime() +' - '+ nd1.getTime());
$('#b').html(
nd1.getFullYear() +'-'+ nd1.getMonth() +'-'+ nd1.getDate() +'<br />'+ nd2.getFullYear() +'-'+ nd2.getMonth() +'-'+ nd2.getDate()
);
有人能解释一下我这段代码有什么问题吗???。为什么31.05.2012
我等于01.06.2012