DateTimeFormatInfo Class Bug - Time Zone Offset has an illegal character - needs to be removed.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Pure Krome (justina_at__NOSPAM_stargatetech.com.au)
Date: 08/10/04


Date: Tue, 10 Aug 2004 12:56:38 +1000

Hi All.

.Net Framework Version: 1.1
Class: System.Globalization.DateTimeFormatInfo
Error: The Full TimeZone Offset is printing an illegal character in the
returned result. The <TimeSeperator> (by default a colon) is being
returned as part of the result: +/- HH<TimeSeperator>MM. This does not
conform to RFC 822 standards. It should be +/- HHMM.

Description:
The .NET help file lists the full time zone offset ("zzz") as the following:
"The full time zone offset ("+" or "-" followed by the hour and
minutes). Single-digit hours and minutes will have leading zeros. For
example, Pacific Standard Time is "-08:00"."

***
The colon should not be there (based upon the RFC standards). I'm
assuming the colon is the TimeSeperator.
***

This error was first noticed when i tried opening up an email (in
outlook 2002 and outlook 2003) i manually created (raw, using telnet)
and setting the date smtp field with a time zone offset as listed above
.. with the colon. Outlook was showing me an incorrect date when i
opened up the individual email.

Looking at the SMTP RFC (RFC 821 - Simple Mail Transfer Protocol,
http://www.faqs.org/rfcs/rfc821.html) and searching for <zone> it lists
the following:-

"<time> ::= <hh> ":" <mm> ":" <ss> <SP> <zone>
  <zone> ::= "UT" for Universal Time (the default) or other
                       time zone designator (as in [2])."

ok.. so what are the zone definitions??? lets look at [2]..
"[2] RFC 822
  Crocker, D., "Standard for the Format of ARPA Internet Text
  Messages," RFC 822, Department of Electrical Engineering,
  University of Delaware, August 1982."

this goes to ...
RFC 822 - Standard for the format of ARPA Internet text messages
(http://www.faqs.org/rfcs/rfc822.html)

searching for zone lists ...

"time = hour zone ; ANSI and Military
  zone = "UT" / "GMT" ; Universal Time
                                                   ; North American : UT
                   / "EST" / "EDT" ; Eastern: - 5/ - 4
                   / "CST" / "CDT" ; Central: - 6/ - 5
                   / "MST" / "MDT" ; Mountain: - 7/ - 6
                   / "PST" / "PDT" ; Pacific: - 8/ - 7
                   / 1ALPHA ; Military: Z = UT;
                                                   ; A:-1; (J not used)
                                                   ; M:-12; N:+1; Y:+12
                   / ( ("+" / "-") 4DIGIT ) ; Local differential
                                                   ; hours+min. (HHMM)"

Notice the last comment / line.

==>> a plus or mine followed by 4DIGIT (HHMM). There is no TimeSeperator
in there.

If outlook recieves an email with an smtp date that conforms to the
above time zone offset standard, it is displayed correctly.

So if we try to create an smtp email and define the smtp date field
using the .NET "zzz" format pattern, it is technically incorrect and
could be displayed incorrectly.

Workaround:
this is the current piece of code i use to get around this bug until it
is fixed / properly formatted. (sorry about the bad formatting).

objBuffer.Append( this.DateTime.ToString( "dddd, d MMMM yyyy HH:mm:ss " ) );
objBuffer.Append( this.DateTime.ToString( "zzz" ).Replace(
System.Globalization.DateTimeFormatInfo.CurrentInfo.TimeSeparator, "" ) );

notice i manually remove the TimeSeperator from the TimeZoneOffset string.

Please comment and fix :)

I hope someone at MS reads this.... otherwise, how can i report this
easy to fix bug?

-- 
- Pure Krome -
* I Live therefore I am Happy; I am Happy therefore I Live.
* What Nourishes Me Also Destroys Me - Angelina Jolie (Stomach Tattoo)
_____________________________________________________________________


Relevant Pages

  • RfD: :NAME
    ... I posted this RfD to the Forth-200x group (originally called HEADER) ... surface of the compiler, is standard. ... There is no good way to construct colon words from within other colon ...
    (comp.lang.forth)
  • Re: :: operator considered harmful?
    ... remove the DIMENSION attribute (I think the DIMENSION ... keyword should have been removed from the standard years ago). ... the declaration includes an initialization. ... The double colon is required ...
    (comp.lang.fortran)
  • Re: EXECUTE
    ... colon definition at compile-time. ... In this case, if you execute: inside of PASS, the R> won't execute ... Please state what is non-compliant about PASS: by pointing us to the appropriate part of the standard. ... TRACEthat is supposedly ANS-Forth compliant, ...
    (comp.lang.forth)
  • Re: The Art and Science of Factoring
    ... It would be nesting if the colon were ... As mentioned by Elizabeth, colon is a standard word, not IMMEDIATE. ... call dolit ...
    (comp.lang.forth)