Have a text input box.
Would like the user to enter a string in the exact format:
2010/08/26 17:04:51.24
(with any numbers of course)
How can I do this efficiently?
Not looking for the answer, just a point in the right direction.
Thank You.
(html, JavaScript and jQuery)
Regular expressions would be the most obvious solution. That being said, you probably don’t want to go through the trouble of implementing a regular expression for matching dates and times when you can instead use an already existing solution.
DateJs is a really great JavaScript date parser that handles converting user-entered dates and times into meaningful values. DateJs can intelligently parse natural language expressions like “tomorrow” or “+5 days” and also standard date and time representations like “10/24/2008 11:31:04 AM”.