- Home /
DateTime.ParseExact throws FormatException
I have a string that is exactly 1900-01-01 00:00:00::000000
and I'm trying to parse it as a DateTime object for a Unity game.
I'm using the same string and format string as on my asp.net server, but only in Unity it fails.
attachment.created = DateTime.ParseExact(created, "yyyy-MM-dd HH:mm:ss::ffffff", CultureInfo.InvariantCulture, DateTimeStyles.None);
I've also tried removing DateTimeStyles.None
and replacing 1900 with 2015.
Exception message says "Invalid format string."
Please help me out with this.
Comment