Description

The DateTime macro is defined like this in HelpOnMacros:

(Last part was my own addition. I have been looking for the W3C time specification, and they are refering to RFC822 themselves.

The RFC is pretty liberal about timestamps, but it does include at least the notion of timezones in the timestamp.

The exact specification is this:

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)

Right now, the DateTime macro only supports the "Z", as in [[DateTime(2005-02-02T13:00:00Z)]], which basically takes the timestamp as UTC-based.

Steps to reproduce

  1. see the example below.

Example

|| GMT || [[DateTime(2005-02-02T13:00:00Z)]] ||
|| EST || [[DateTime(2005-02-02T13:00:00EST)]] ||
|| D (mil) || [[DateTime(2005-02-02T13:00:00D)]] ||

Gives:

GMT

2005-02-02 13:00:00

EST

2005-02-02 13:00:00

D (mil)

2005-02-02 13:00:00

When it should give:

GMT

2005-02-02 09:00:00

EST

2005-02-02 13:00:00

D (mil)

2005-02-02 13:00:00

(assuming we're in the EST timezone).

Details

This Wiki.

Workaround

A little arithmetic: always input the time in UTC.

Discussion

I suggest to actually look at RFC 2822 instead of 822, and adhere to that. Please see http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2822.html#sec-4.3 and note that above cited timezones have been obsoleted, the only supported way is now zone = (( "+" / "-" ) 4DIGIT) (not accounting for obs-zone). I do agree that the +/- format should be supported though. -- JohannesBerg 2005-02-04 21:56:26

Well, seems to me that the major part of the problem is making DateTime "timezone-conscious": once we have that, implementing whatever shortcuts should be relatively easy... -- TheAnarcat 2005-02-04 22:15:25

This is not a bug, but simply a missing feature. I added code for +/-HHMM parsing. Z will also still be accepted (same as +0000). -- ThomasWaldmann 2005-03-06 18:39:09

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/DateTimeNotRfcCompliant (last edited 2007-10-29 19:10:41 by localhost)