Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用C#代码隐藏获取javascript日期格式_C#_Javascript_Kendo Ui - Fatal编程技术网

如何使用C#代码隐藏获取javascript日期格式

如何使用C#代码隐藏获取javascript日期格式,c#,javascript,kendo-ui,C#,Javascript,Kendo Ui,我正在使用剑道日历,需要在日历上突出显示具体日期。根据剑道演示,突出显示的日期是javascript中的wriiten,如下所示: dueDates= [ +new Date(today.getFullYear(), today.getMonth(), 8), +new Date(today.getFullYear(), today.getMonth(), 12),

我正在使用剑道日历,需要在日历上突出显示具体日期。根据剑道演示,突出显示的日期是javascript中的wriiten,如下所示:

 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)
                        ];
Duedate的价值为:

[1357583400000,1357929000000,1358965800000,1360089000000,1360175400000,
1361730600000,1361903400000,1354473000000,1354645800000,1353522600000,1353954600000]

我有代码隐藏的日期列表,需要转换为上述格式的日期。请帮忙。

这个数字
1357583400000
看起来像
01-01-1970
()中的
总毫秒数。将其转换回.Net DateTime。你可以做:

DateTime dt = new DateTime(1970, 1, 1).AddMilliseconds(1357583400000);

您将得到:
{07/01/2013 6:30:00 PM}
作为日期时间

这个数字
1357583400000
看起来像
01-01-1970
()中的
总毫秒数。将其转换回.Net DateTime。你可以做:

DateTime dt = new DateTime(1970, 1, 1).AddMilliseconds(1357583400000);

您将获得:
{07/01/2013 6:30:00 PM}
作为DateTime

感谢您的回复。但我需要的数据是'1357583400000'而不是日期。尝试给出“新的日期时间(2013,1,8).ToFileTimeUtc();”值为“13002076800000000”,这同样不起作用。@psobhan,您可以使用TimeSpan
(dt-新日期时间(1970,1,1))。TotalMillistics
将为您提供总毫秒,即:
1357583400000
Thank.Added-5.5小时以突出显示日历中的特定日期。DateTime due=Convert.ToDateTime(date).AddHours(-5.5);谢谢你的回复。但我需要的数据是'1357583400000'而不是日期。尝试给出“新的日期时间(2013,1,8).ToFileTimeUtc();”值为“13002076800000000”,这同样不起作用。@psobhan,您可以使用TimeSpan
(dt-新日期时间(1970,1,1))。TotalMillistics
将为您提供总毫秒,即:
1357583400000
Thank.Added-5.5小时以突出显示日历中的特定日期。DateTime due=Convert.ToDateTime(date).AddHours(-5.5);