Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.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
将javascript时间转换为asp.net日期时间。立即_Javascript_Asp.net_.net_Datetime - Fatal编程技术网

将javascript时间转换为asp.net日期时间。立即

将javascript时间转换为asp.net日期时间。立即,javascript,asp.net,.net,datetime,Javascript,Asp.net,.net,Datetime,我正在尝试将javascript日期转换为ASP.NET的日期时间 var todaysDate = new Date(); document.getElementById('hdnDate').value = todaysDate.toString(); private void ConvertToDotNetDateTime() { DateTime myDate = (DateTime)hdnDate.Value; ??? ? //bit lost here } 您可以使用将

我正在尝试将javascript日期转换为ASP.NET的日期时间

var todaysDate = new Date();
document.getElementById('hdnDate').value = todaysDate.toString();


private void ConvertToDotNetDateTime()
{
    DateTime myDate = (DateTime)hdnDate.Value; ??? ? //bit lost here
}
您可以使用将日期转换为日期时间。现在

var todaysDate = new Date();
document.getElementById('hdnDate').value = todaysDate.toString();


private void ConvertToDotNetDateTime()
{
    DateTime myDate = (DateTime)hdnDate.Value; ??? ? //bit lost here
}
您可以检查JavaScript:

document.getElementById('hdnDate').value = (new Date()).format('dd/MM/yyyy HH:mm:ss');
在C#中:


希望这对某人有所帮助。

重复-1。你的很多答案似乎都是由“检查链接”组成的,而这并不是问题所在——特别是当同一链接在40分钟前已经作为评论发布时。