Hello,
I've been struggling with this all afternoon, and everything I find on Google seems to talk about converting dates and times TO the format I've already got.
I have an XML file which has recorded a date and time of:
2009-03-28T16:24:22+00:00
What I want to know is how I convert it to dd/MM/yyyy.
In my despiration, I've started working with substrings to break it up and re-assemble it again, but there has got to be a better way.
One of the latest things I've tried is:
... but this complains that The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.Code:strDate = strDate.Substring(0, 10) Dim dteDate As DateTime = DateTime.ParseExact(strDate, "yyyy-MM-dd", New Globalization.CultureInfo("en-GB"))
Convert.ToDateTime(strDate) doesn't seem to want to play either.




Reply With Quote