Y
Yin99
I have the string "8/2/2007 12:00:00 AM"
I'd like to get this in DateTime variable so I can manipulate (e.g.
use TimeSpan to find difference). However, when I look at the
DateTime constructors, everything seems to be int, long, etc.
So my question is, what would be the easiest way to get this into
DateTime? Seems like a long way would be to split at the "/", parse
out, use int.Parse, etc (brute force). But I was wondering if there
was a quick and cleaver way to do this in minimal lines of code?
Thanks- Yin
background info: i'm using DateTimePicker control and reading the
value which returns a string in format above. I have two
DateTimePickers and need to know the number of months between the
value in the first DateTimePicker and the second DateTimePicker.
I'd like to get this in DateTime variable so I can manipulate (e.g.
use TimeSpan to find difference). However, when I look at the
DateTime constructors, everything seems to be int, long, etc.
So my question is, what would be the easiest way to get this into
DateTime? Seems like a long way would be to split at the "/", parse
out, use int.Parse, etc (brute force). But I was wondering if there
was a quick and cleaver way to do this in minimal lines of code?
Thanks- Yin
background info: i'm using DateTimePicker control and reading the
value which returns a string in format above. I have two
DateTimePickers and need to know the number of months between the
value in the first DateTimePicker and the second DateTimePicker.