G
Guest
I have a string variable that holds the equivalent of a DateTime value. I
pulled this datetime from the database and I want to strip off the time
portion before displaying to the user.
I am using C#
eg.
- String variable "strMyDate" holds the value "1/1/2005 12:00:00 AM" from
the database.
- I do not care about the time portion, I only want "1/1/2005" for display.
What can I do to the string variable "strMyDate" to strip out the time portion
I've ran in circles using the DateTime.Parse and ParseExact functions, I'm
not sure how to best go about this. It used to be so easy in VB 6.0, using
the Format method. How can I accomplish this using C# ?
pulled this datetime from the database and I want to strip off the time
portion before displaying to the user.
I am using C#
eg.
- String variable "strMyDate" holds the value "1/1/2005 12:00:00 AM" from
the database.
- I do not care about the time portion, I only want "1/1/2005" for display.
What can I do to the string variable "strMyDate" to strip out the time portion
I've ran in circles using the DateTime.Parse and ParseExact functions, I'm
not sure how to best go about this. It used to be so easy in VB 6.0, using
the Format method. How can I accomplish this using C# ?