0

I am trying to parse the following string

Tue Mar 23 22:59:59 UTC 2027

into a DateTime with the following code

var dt = DateTime.ParseExact( dateString, "ddd MMM dd HH:mm:ss Z yyyy", CultureInfo.InvariantCulture );

But I get

System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)

Any suggestion?

EDIT: Thank you for closing the question. Just wanted to notify that the referenced question does not answer this one.

Lorenzo
  • 29,081
  • 49
  • 125
  • 222

0 Answers0