Hello Fred. I'm the development owner of the DateTime class.
I could not come up with an exlplanation for what you were seeing, so I got
your repro and debugged it. I think you have found a valid bug in the
product and I have fixed it for the next release (Whidbey).
The problem is that ParseExact cannot parse a value like "-5:00" for the
"zzz" format. It requires two leading digits like so: "-05:00". This is a
bug, because DateTime.Parse will accept a single leading digit, and the
ISO8601 allows it also.
Hopefully passing in "-05:00" can be an effective work-around to unblock
you here. In general, Parse and Exact are good at round-tripping a value
the exact same way that it is formatted by ToString. If you are having
trouble with a format, try calling ToString on the format to determine what
it is looking for.
Thanks very much for asking the question. It allows us to make the product
better, and will help you determine if it is pilot error. I hope this does
not inconvience you too much.
Anthony.
--------------------
| From: Fred Strauss <frauss@comcast.net>
| Subject: Problem with DateTime.ParseExact
[quoted text clipped - 5 lines]
| Content-Transfer-Encoding: 7bit
| Newsgroups:
microsoft.public.dotnet.framework.clr,microsoft.public.dotnet.languages.csha
rp
| NNTP-Posting-Host: pcp01721375pcs.union01.nj.comcast.net 68.37.29.230
| Lines: 1
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.languages.csharp:205152
microsoft.public.dotnet.framework.clr:8979
| X-Tomcat-NG: microsoft.public.dotnet.framework.clr
|
[quoted text clipped - 31 lines]
| 212-621-1968
| fred_strauss@ap.org
Fred Strauss - 23 Dec 2003 11:52 GMT
Anthony, thanks for getting back to me.
I've already got a workaround but it's nice to know I wasn't losing my
mind in thinking this should have worked.
Fred
>Hello Fred. I'm the development owner of the DateTime class.
>
[quoted text clipped - 74 lines]
>| 212-621-1968
>| fred_strauss@ap.org