String transfer time

Since Js pass data to the background a lot of time to pass the time passes controller is a string, we need to use this time should be very simple way to turn time.
Input can see the label obtained at this time to time in FIG.
Here Insert Picture Description
All controllers spread when a breakpoint and then look at the JS code inside the resulting string time string can only be used to receive him
here has been a string of time you can go submitted.
Here Insert Picture Description
The first method is a receiving code directly DateTime statement string.

public ActionResult Date(DateTime Date)

Then you can see the status Date at this time is the time format. And when coupled with the minutes and seconds to zero.
Here Insert Picture Description
A first receiving method to receive the Datetime string.
This next method is relatively trouble spots. Receiving a string and then use this time to convert the string to an universal time.

public ActionResult Date(string Date)
{
DateTime Datea = Convert.ToDateTime(Date);
}

Here you can see the received character string type is
Here Insert Picture Description
then followed by a spin-up time can see a time format.
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_44486126/article/details/92760441