G
Guest
Hi.
I have a string: "11/24/2006 23:59" named StartDateTime
I need the string to be converted into a DateTime object in the following
format: 2006-11-24 11:59 PM
I tried the following: DateTime.ParseExact(StartDateTime,"yyyy-MM-dd HH:mm
tt*", System.Globalization.CultureInfo.CurrentCulture)
When StartDateTime = "11/24/2006 23:55" the date returned = 0000-00-00 00:00
When StartDateTime = "11/24/2006 3:00 AM", I get the following error:
System.FormatException: String was not recognized as a valid DateTime.
Any help any of you can offer would be greatly appreciated. Thanks!
I have a string: "11/24/2006 23:59" named StartDateTime
I need the string to be converted into a DateTime object in the following
format: 2006-11-24 11:59 PM
I tried the following: DateTime.ParseExact(StartDateTime,"yyyy-MM-dd HH:mm
tt*", System.Globalization.CultureInfo.CurrentCulture)
When StartDateTime = "11/24/2006 23:55" the date returned = 0000-00-00 00:00
When StartDateTime = "11/24/2006 3:00 AM", I get the following error:
System.FormatException: String was not recognized as a valid DateTime.
Any help any of you can offer would be greatly appreciated. Thanks!