[英]How to get javascript date format using C# code behind
我正在使用Kendo压光机,需要突出显示压光机中的特定日期。 按照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]
我的代码后面有日期列表,需要将其转换为上述格式的日期。 请帮助。
这个数字1357583400000
看起来像是从01-01-1970
( Unix Epoch )起的TotalMilliSeconds
。 将其转换回.Net DateTime。 你可以做:
DateTime dt = new DateTime(1970, 1, 1).AddMilliseconds(1357583400000);
您将获得: {07/01/2013 6:30:00 PM}
作为DateTime
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.