Received: (qmail 68523 invoked by uid 501); 12 May 2001 11:48:06 -0000 Message-Id: <20010512114806.68522.qmail@apache.org> Date: 12 May 2001 11:48:06 -0000 From: Eduardo "Pérez" Ureta Reply-To: eperez@dei.inf.uc3m.es To: submit@bugz.apache.org Subject: The date from mod_autoindex is not the standard ISO 8601 X-Send-Pr-Version: 3.110 >Number: 7710 >Category: mod_autoindex >Synopsis: [Patch] The date/time from mod_autoindex is unclear to end-users >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: suspended >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat May 12 04:50:00 PDT 2001 >Closed-Date: >Last-Modified: Sat May 12 08:20:00 PDT 2001 >Originator: eperez@dei.inf.uc3m.es >Release: 1.3.19 >Organization: >Environment: all >Description: Apache should use the standard date format ISO 8601. Apache should use gmtime instead of localtime. If you don't live in the same timezone as the server how do you understand the date ? For more information: http://www.cl.cam.ac.uk/~mgk25/iso-time.html >How-To-Repeat: >Fix: --- apache-1.3.19/contrib/mod_autoindex/mod_autoindex.c Fri Apr 13 16:26:13 2001 +++ apache-1.3.19/contrib/mod_autoindex/mod_autoindex.c Fri Apr 13 16:55:24 2001 @@ -1519,11 +1519,11 @@ if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { emit_link(r, "Last modified", K_LAST_MOD, keyid, direction, static_columns); - ap_rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_SIZE)) { emit_link(r, "Size", K_SIZE, keyid, direction, static_columns); - ap_rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_DESC)) { emit_link(r, "Description", K_DESC, keyid, direction, @@ -1597,13 +1597,13 @@ if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { char time_str[MAX_STRING_LEN]; - struct tm *ts = localtime(&ar[x]->lm); - strftime(time_str, MAX_STRING_LEN, "%d-%b-%Y %H:%M ", ts); + struct tm *ts = gmtime(&ar[x]->lm); + strftime(time_str, MAX_STRING_LEN, "%Y-%m-%dZ%H:%M:%S ", ts); ap_rputs(time_str, r); } else { - /*Length="22-Feb-1998 23:42 " (see 4 lines above) */ - ap_rputs(" ", r); + /*Length="1998-02-22Z23:42:34 " (see 4 lines above) */ + ap_rputs(" ", r); } } if (!(autoindex_opts & SUPPRESS_SIZE)) { >Release-Note: >Audit-Trail: State-Changed-From-To: open-suspended State-Changed-By: wrowe State-Changed-When: Sat May 12 07:48:38 PDT 2001 State-Changed-Why: First, there are some client applications that parse the mod_autoindex output, which would (or will) be broken by this change. Please don't expect it to be applied until Apache 2.0 where a better schema is introduced, including proper, parsable XML. But I see two issues, one, you are introducing seconds (which is certainly not a requirement within ISO8601), and second, your patch violates ISO8601 by prepending the zulu time _suffix_. At a minimum, the format needs to show "1998-02-22 23:42Z", not "1998-02-22Z23:42:34". Since the timezone is a constant through the listing, it can (perhaps) be omitted entirely for brevity. The Zulu time suffix has the annoying property of appearing (in many typefaces, to many folks) as the digit 2. Better to display the heading as "Last Modified (Z)" or "Last Modified (+0000)" rather than intrude on the limited space available within the listing itself. On the issue of 'dictating' this to Apache users, many web sites _are_ local, with local content aimed at a local audience. This proposal needs some controling directives to give the operator some flexibility, by vhost, to make the information meaningful in it's context. And finally, the user obviously is the end-target of this information. Some facility to specify the time zone with the request would be a very worthwhile facility. This would need to be done such that other users don't see the cached results of the request, so it would need to be some sort of ?z=+0500 or ?z=-0100 argument. Under Apache 2.0, apr is being updated to allow this sort of fine-grained control of dates for an international audience. This work [while breaking existing consumers of mod_autoindex results] should be done once for all. Thanks for the proposal and your patch, I'll tag it as suspended for consideration in Apache 2.0. Synopsis-Changed-From: The date from mod_autoindex is not the standard ISO 8601 Synopsis-Changed-To: [Patch] The date/time from mod_autoindex is unclear to end-users Synopsis-Changed-By: wrowe Synopsis-Changed-When: Sat May 12 07:48:38 PDT 2001 From: =?iso-8859-1?Q?Eduardo_P=E9rez_Ureta?= To: wrowe@apache.org Cc: apbugs@Apache.Org Subject: Re: mod_autoindex/7710: The date from mod_autoindex is not the standard ISO 8601 Date: Sat, 12 May 2001 15:19:45 +0000 On 2001-05-12 14:48:38 -0000, wrowe@apache.org wrote: > First, there are some client applications that parse the mod_autoindex output, which > would (or will) be broken by this change. Please don't expect it to be applied until > Apache 2.0 where a better schema is introduced, including proper, parsable XML. OK, XML is much better. > But I see two issues, one, you are introducing seconds (which is certainly not a > requirement within ISO8601), and second, your patch violates ISO8601 by prepending > the zulu time _suffix_. OK, this is not standard. Maybe it was standard time ago. > At a minimum, the format needs to show "1998-02-22 23:42Z", not "1998-02-22Z23:42:34". > Since the timezone is a constant through the listing, it can (perhaps) be omitted > entirely for brevity. The Zulu time suffix has the annoying property of appearing > (in many typefaces, to many folks) as the digit 2. Better to display the heading > as "Last Modified (Z)" or "Last Modified (+0000)" rather than intrude on the limited > space available within the listing itself. If you omit the timezone then you should refere to UTC. > On the issue of 'dictating' this to Apache users, many web sites _are_ local, with > local content aimed at a local audience. This proposal needs some controling > directives to give the operator some flexibility, by vhost, to make the information > meaningful in it's context. But by default should be UTC. If it's not UTC mod_autoindex should show always the timezone. > And finally, the user obviously is the end-target of this information. Some facility > to specify the time zone with the request would be a very worthwhile facility. This > would need to be done such that other users don't see the cached results of the > request, so it would need to be some sort of ?z=+0500 or ?z=-0100 argument. Why is not the user the one that put the date sent by apache in the stangest time format he wants. Using only XML would be great ! But I know old browsers can't get XML > Under Apache 2.0, apr is being updated to allow this sort of fine-grained control of > dates for an international audience. This work [while breaking existing consumers > of mod_autoindex results] should be done once for all. The best solution would be using only XML with UTC. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]