[Mono-devel-list] [PATCH] Various DateTime fixes and tests

Steven Brown swbrown at ucsd.edu
Wed Jun 2 17:42:52 EDT 2004


Hello, I've fixed up the DateTime class a bit.  Here are the changes:


Fixes the 'exact' flag not being honored which meant DateTime strings 
were matching the wrong patterns.

Fixes handling of milliseconds in _DoParse so it properly captures all 
provided digits.

Fixes the 'Z' type format always matching even if no 'Z' was specified.

Fixes ISO 8601 timezones not handling the case where the colon is left out.

Fixes AddMilliseconds to round to the tick, not to the nearest 
millisecond, as documented for the method.

Indirectly fixes XmlConvert.ToDateTime's ability to parse milliseconds, 
as it uses ParseExact.


I've also included additional tests for DateTime that test what's fixed 
here.  With mcs-DateTime-fixes3-swb.patch applied, there are still two 
tests added here that fail:


MonoTests.System.DateTimeTest.Milliseconds: Fails due to Parse not 
handling ISO 8601 styles.  Previously wouldn't have failed, but that was 
due to another bug ('exact' not being honored).  XmlConvert handles 
these styles correctly.

MonoTests.System.DateTimeTest.ParseNotExact: Fails due to Parse calling 
ParseExact internally, which is obviously wrong.


I don't have commit, so can some empowered monkey review this and add it 
to the tree?  Would like to have this in before 1.0, as it's needed to 
fix DateTime deserialization with some webservices (ones using nusoap 
for example).

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mcs-DateTime-fixes3-swb.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040602/147a8dec/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mcs-DateTime-tests2-swb.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040602/147a8dec/attachment-0001.pl 


More information about the Mono-devel-list mailing list