date-design-pattern: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(→‎Specificity: New section, add note about dates without months and days.)
(noted W3C QA tip on Use international date format (ISO) - Quality Web Tips and citation/quote that ISO8601 dates (with hyphens!) are best for more accurately readable by most people worldwide.)
Line 13: Line 13:
The [[datetime-design-pattern]] arose as a result of solving the practical need for human readable dates for [[hcalendar|hCalendar]]. While concerns have been raised about the readability of complete datetimes, those concerns don't apply for date stamps that do not include time or timezone information.
The [[datetime-design-pattern]] arose as a result of solving the practical need for human readable dates for [[hcalendar|hCalendar]]. While concerns have been raised about the readability of complete datetimes, those concerns don't apply for date stamps that do not include time or timezone information.


The date design pattern provides an internationalized way of representing dates. For example, the string 02/03/01 could represent February 3rd 2001, March 2nd 2001 or even March 1st 2002 depending on the cultural context. The string 2001-03-02 is less ambiguous.
The date design pattern provides an internationalized way of representing dates. For example, the string 02/03/01 could represent February 3rd 2001, March 2nd 2001 or even March 1st 2002 depending on the cultural context. The string 2001-03-02 is less ambiguous and is the best choice for accurate readability for the most people worldwide.


== How to use it ==
== How to use it ==
Line 51: Line 51:


==Accessibility issues==
==Accessibility issues==
Concerns have raised about accessibility issues [http://www.webstandards.org/2007/04/27/haccessibility/] with the [[datetime-design-pattern]] when it is used in conjunction with the [[abbr-design-pattern]].


Concerns have raised about accessibility issues [http://www.webstandards.org/2007/04/27/haccessibility/] with the [[datetime-design-pattern]] when it is used in conjunction with the [[abbr-design-pattern]]. These concerns are significantly lessened with the [[date-design-pattern]] as only dates, rather than full datetimes, are represented
These concerns are both significantly lessened with the [[date-design-pattern]] as only dates, rather than full datetimes, and in fact improved, as the ISO8601 YYYY-MM-DD format for dates is the best choice that is the most accurately readable for the most people worldwide, and thus the most accessible as well.


== Specificity ==
== Specificity ==
Line 64: Line 65:
* The [[abbr-design-pattern]] can be used by [[date-design-pattern]]
* The [[abbr-design-pattern]] can be used by [[date-design-pattern]]
* RFC [http://www.faqs.org/rfcs/rfc3339.html 3339]: Date and Time on the Internet: Timestamps
* RFC [http://www.faqs.org/rfcs/rfc3339.html 3339]: Date and Time on the Internet: Timestamps
* W3C: [http://www.w3.org/QA/Tips/iso-date Use international date format (ISO) - Quality Web Tips]: "Albeit not perfect, ISO date format is, however, the best choice for a date representation that is universally (and accurately) understandable."
* W3C: [http://www.w3.org/TR/NOTE-datetime Note on Datetimes]  
* W3C: [http://www.w3.org/TR/NOTE-datetime Note on Datetimes]  
* Markus Kuhn: [http://www.cl.cam.ac.uk/~mgk25/iso-time.html A summary of the international standard date and time notation]
* Markus Kuhn: [http://www.cl.cam.ac.uk/~mgk25/iso-time.html A summary of the international standard date and time notation]
* Wikipedia: [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]
* Wikipedia: [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601]

Revision as of 22:14, 24 February 2009

This page is a draft.

Date Design Pattern

This is a page for exploring a date design pattern. This pattern is a subset of the datetime-design-pattern.

Purpose

Use the date-design-pattern to make dates that are human readable also formally machine readable.

Practical Need

The datetime-design-pattern arose as a result of solving the practical need for human readable dates for hCalendar. While concerns have been raised about the readability of complete datetimes, those concerns don't apply for date stamps that do not include time or timezone information.

The date design pattern provides an internationalized way of representing dates. For example, the string 02/03/01 could represent February 3rd 2001, March 2nd 2001 or even March 1st 2002 depending on the cultural context. The string 2001-03-02 is less ambiguous and is the best choice for accurate readability for the most people worldwide.

How to use it

The full datetime-design-pattern has the format:

YYYY-MM-DDTHH:MM:SS+ZZ:ZZ

The date design pattern, which is a subset of the datetime design pattern, has the format:

YYYY-MM-DD

The date design pattern can be used like any other value that uses the class-design-pattern:

<span class="foo">YYYY-MM-DD</span>

The date design pattern can also be used in combination with the abbr-design-pattern where authors want to provide an alternative representation of the date:

<abbr class="foo" title="YYYY-MM-DD">Date</abbr>

As with the datetime design pattern, the date design pattern is based on the ISO8601 standard. This standard allows for dates to be written without dashes (YYYYMMDD). This usage is strongly discouraged when publishing microformats as it significantly reduces the readability of the date.

Current uses

This pattern can be used in hCalendar for:

  • dtstart
  • dtend

In hCard the date design pattern can be used for:

  • bday

This pattern can be used in hReview for:

  • dtreviewed

Accessibility issues

Concerns have raised about accessibility issues [1] with the datetime-design-pattern when it is used in conjunction with the abbr-design-pattern.

These concerns are both significantly lessened with the date-design-pattern as only dates, rather than full datetimes, and in fact improved, as the ISO8601 YYYY-MM-DD format for dates is the best choice that is the most accurately readable for the most people worldwide, and thus the most accessible as well.

Specificity

ISO 8601 and W3CDTF (but not RFC 3339) allow less specific dates, excluding the day and month. e.g. "2008-09" (September 2008) or "2008" (the year 2008). It is unclear whether the date pattern is intended to allow such dates, but certainly most microformat parsers seem to support them.

See Also