Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Nov 21, 2017

In recently merged pull request #457, we used the format string o to format DateTimeOffset objects to the Iso8601 format.

Although this works for output, it does not work for parsing. Usingn o in DateTimeOffset.Parse() or DateTimeOffset.ParseExact() throws an exception with Invalid Format String as the message.

Using the format string yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz outputs the same content as o, but also has the added benefit of working in Mono/Unity.

@drguthals
Copy link

Looks good!

@grokys
Copy link

grokys commented Nov 21, 2017

What do you mean by:

Although this works for output, it does not work for parsing.

What doesn't work for parsing? You can't parse ISO8601 format dates on mono?

@StanleyGoldman
Copy link
Contributor Author

I never heard of the DateTimeOffset format string o until recently.
When I use that same format string in DateTimeOffset.Parse() or DateTimeOffset.ParseExact() I get an Invalid Format String error.

I'll update the body above to be clearer...

@StanleyGoldman StanleyGoldman merged commit 6af1fca into master Nov 21, 2017
@StanleyGoldman StanleyGoldman deleted the fixes/date-time-format-string branch November 21, 2017 16:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants