For use in the search method, I would like to analyze partial dates in different formats. I want the user to be able to search for day and month, month and year, as well as day and month and year.
But all the more problematic is that I want to do this in all possible date formats, depending on the country in which the user is located. This is an ASP.NET page, and I can use CultureInfo and therefore CultureInfo.DateTimeFormat.
Do you have any idea how to do this? I think it would be great that a British person could search for 16/05, and an American could enter 05/16, or German could use 16.05 to find the result from May 16th.
I think you can use DateTimeFormat.ShortDatePattern. But how can I use it to get day, month and year out of them?
I think about using type
public void GetDateParts(string SearchStr, out int? day, out int? month, out int? year)
Thanks to everyone who can help me.
Marks source
share