This can get quite complicated at times but is also very easy to resolve.
Either you can use heavy clientside Javascript or the likes to make sure the user is only allowed to input stuff in a certain format or even use a library that will give the user a nice date/time input box.
You can also go the other way of having a plain input box, let the user type whatever they want and then try to convert it server side and then tell them off if they've input the datetime in the wrong format.
Or of course, you can use both.
// Json