G
Guest
I am using the DateTime.Parse method to parse user entered dates. The dates
can be just the year, Month-year and Month-day-year in a variety of formats
in a variety of cultures. I immediately parse out the year case since I can
determine that very easily (ie it is 4 digits) and store a boolean to let me
know it is just a year.
The problem I am encountering is how to tell if a date has been entered with
just month year or month day year. For example, the following two entries
will result in the same DateTime value.
5/1/2007
5/2007
Also this will result in the same DateTime value
March 1, 2007
March 2007
I need to be able to differentiate the difference. I just need a way even on
parse to determine the difference. What are people's thoughts on the optimal
way to do this?
thanks for any help that people can supply,
-joe-
can be just the year, Month-year and Month-day-year in a variety of formats
in a variety of cultures. I immediately parse out the year case since I can
determine that very easily (ie it is 4 digits) and store a boolean to let me
know it is just a year.
The problem I am encountering is how to tell if a date has been entered with
just month year or month day year. For example, the following two entries
will result in the same DateTime value.
5/1/2007
5/2007
Also this will result in the same DateTime value
March 1, 2007
March 2007
I need to be able to differentiate the difference. I just need a way even on
parse to determine the difference. What are people's thoughts on the optimal
way to do this?
thanks for any help that people can supply,
-joe-