c# - ASP.NET MVC DateTime manual input conversion best practice -
I have an ASP.NET MVC site that contains dates with a text field with the normal HTML form.
& lt; Input type = "textbox" name = "date" /> looks like the control method:
zero doSomething (date time date) {....} < P> How can I handle datetime formats for users to enter different locations and dates of habits? I think the code should be that which tries to parse the string in many date time formats. Can I handle all the datetime parameters, without the help of helper class calls at all times, every time the date of the date of the controller is expected? How do I take account user locale? Thank you in advance!
You can use for example, and set the format. This will be a better user experience, then a simple text box.
$ ('# datetime'). Date picture ({Format: 'yy-mm-dd hh: ii'}); The date picker provides support for localizing your content to meet different languages and date formats.
Comments
Post a Comment