我正在使用Kendo日历,需要在日历中突出显示特定日期。根据剑道演示,要突出显示的日期在javascript中如下所示:
dueDates= [
+new Date(today.getFullYear(), today.getMonth(), 8),
+new Date(today.getFullYear(), today.getMonth(), 12),
+new Date(today.getFullYear(), today.getMonth(), 24),
+new Date(today.getFullYear(), today.getMonth() + 1, 6),
+new Date(today.getFullYear(), today.getMonth() + 1, 7),
+new Date(today.getFullYear(), today.getMonth() + 1, 25),
+new Date(today.getFullYear(), today.getMonth() + 1, 27),
+new Date(today.getFullYear(), today.getMonth() - 1, 3),
+new Date(today.getFullYear(), today.getMonth() - 1, 5),
+new Date(today.getFullYear(), today.getMonth() - 2, 22),
+new Date(today.getFullYear(), today.getMonth() - 2, 27)
];
和dueDates的值是:
[1357583400000,1357929000000,1358965800000,1360089000000,1360175400000,
1361730600000,1361903400000,1354473000000,1354645800000,1353522600000,1353954600000]
我在代码后面有日期列表,需要转换为上述格式的日期。请帮助。
答案 0 :(得分:1)
这个号码1357583400000
看起来像TotalMilliSeconds
01-01-1970
DateTime dt = new DateTime(1970, 1, 1).AddMilliseconds(1357583400000);
。将其转换回.Net DateTime。你可以这样做:
{07/01/2013 6:30:00 PM}
你将得到:{{1}}作为DateTime