I'm trying to convert the javascript date to ASP.NET's DateTime.Now
var todaysDate = new Date();
document.getElementById('hdnDate').value = todaysDate.toString();
private void ConvertToDotNetDateTime()
{
    DateTime myDate = (DateTim开发者_Go百科e)hdnDate.Value; ??? ? //bit lost here
}
JavaScript:
document.getElementById('hdnDate').value = (new Date()).format('dd/MM/yyyy HH:mm:ss');
in C#:
CultureInfo provider = CultureInfo.InvariantCulture;
string date = hfClientDate.Value;
string format = "dd/MM/yyyy HH:mm:ss";
DateTime dt = DateTime.ParseExact(date, format, provider);
Hope this helps someone.
You can use DateTime.ParseExact to convert the date to DateTime.Now
You can check the Example
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论