I need to extract the dateformat from a given date. How am I suppose to do that. Please help.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most of dates are built like this:
Where s is a separator that can be
'/', '.', ' 'or even''.x,yandzare digits. The problem is that you cannot solve the date format for every possible date because of its ambiguity:You need additional information (is there any separator?) or some preconditions (year-month-day or year-day-month?) in order to be able to do that. (Same for time… of course)
If you have this preconditions, so you might try with regular expressions. DateTime isn’t able to do that for you.