[whatwg] Time and Date

Matthew Raymond mattraymond at earthlink.net
Sat Mar 24 06:28:44 PDT 2007


Colin Lieberman wrote:
> Matthew Raymond wrote:
>>    I support the <time> element for the opposite reason, in fact. I
>> don't want to see authors styling the date format. I'd rather see the
>> date format localized or customized to a user preference. If the author
>> wants it in a specific format, they can use CSS to style the element in
>> such a way as to show its contents:
>>
>> HTML:
>> | <time datetime="YYYY-MM-DD">(*)???MMMM;YY;D???(*)</time>
>>
>> CSS (using css3-content):
>> | time { content: contents; }
> 
> I agree to a point. Time and date should be machine readable in markup, 
> but I don't know if UAs should *default* to user preference over-riding 
> the author's chosen format.

   The user agents can do whatever they want. If the user wants to turn
off localization and use the format provided by the author, there's
nothing preventing user agent vendors from providing that functionality.
Another possibility is that there could be a tooltip that pops up with
the localized format when you hover the element. The spec should be
flexible enough to allow user agent vendors to decide what's best for
their users.

> My argument here is cultural or sociological - If, in 10 years, kids 
> grew up only ever seeing dates presented in one format, they wouldn't 
> learn about how dates work elsewhere. This seems like a small thing, but 
> I think the flavor of dealing with varieties of date formats is just one 
> way that we get to participate in a really cool, big world full of lots 
> of different people.

   With all due respect, there are too many date formats just in the
United States alone. While you may have some nostalgia for various date
formats, having different formats make it harder to read the dates,
especially when the year is abbreviated (in which case you may not even
be able to read the date at all).

> Yes - dates should be standardized for machines. This allows AT to help 
> folks with (for example) learning disabilities.

   Correct, and in addition, you can use it for things like scheduling
events or opening your calendar to see if you're doing anything at that
date and time. Also, in editors, it would allow you to very quickly
change the fallback date format.

> No - people should not only be served one flavor of date format unless 
> they need it.

   Right now they are being served one flavor: the author's. If the user
wants to see a localized date for their convenience, one can hardly
argue that they should be forced to view the original format provided by
the author. If they don't like localization, the user agent vendors can
always allow the feature to be turned off.

   Keep in mind that the date and time inputs will be localized as well,
so it only makes sense that localization for <time> should be the
default. Otherwise, the page could have date information in a different
format from that of the date controls.



More information about the whatwg mailing list