P
Peter Kirk
Hi there
I would like some help with parsing date strings to DateTime structures.
I can see that DateTime has Parse and ParseExact methods - but I am not sure
what is best for me to use, and what parameters I need to supply.
I reveive a string from a web-form, which would look something like this:
"31-12-1999 14:56:22"; and I need to parse it to a DateTime
The ParseExact method has one form that looks like this:
ParseExact(string s, string format, IFormatProvider provider)
but I don't understand what the format-provider is or why it is required,
and how it is different from the supplied format.
Any one have some good suggestions for converting strings to DateTimes?
Thanks for any help,
Peter
I would like some help with parsing date strings to DateTime structures.
I can see that DateTime has Parse and ParseExact methods - but I am not sure
what is best for me to use, and what parameters I need to supply.
I reveive a string from a web-form, which would look something like this:
"31-12-1999 14:56:22"; and I need to parse it to a DateTime
The ParseExact method has one form that looks like this:
ParseExact(string s, string format, IFormatProvider provider)
but I don't understand what the format-provider is or why it is required,
and how it is different from the supplied format.
Any one have some good suggestions for converting strings to DateTimes?
Thanks for any help,
Peter