Gentoo Logo

Test Date Formatting

Content:

1.  Introduction

Some information

In order to be able to process the date elements in XSLT or scripts, we have added support for a YYYY-MM-DD formatted date element.

Besides, some people have been very creative and dates are formatted in many different ways in English and in many translations. This allows for consistency across all pages.

XSLT 2.0 has some date formatting routines but XSLT 1.0 hasn't and it seems like we'll have to do with it for quite a while.

Fortunately, we do not need any advanced date checking and validating library. All we need is to be able to display YYYY-MM-DD in a limited set of languages.

The table below shows different examples of dates formatted for different languages.

The <date> element in our documentation is expected to be formatted as YYYY-MM-DD so that it can be easily used in automatic processing. If a date does not match that pattern, it is copied verbatim for backwards compatibility. Otherwise, it is formatted for the given language according to the lang attribute of the root element. The default language is English of course.

Test and send feedback

The dates below have been formatted based on my limited knowledge of dates in plenty of languages, on how they currently appear in the docs and on your feedback. Some guesses are probably right, some less because of the many different formats currently used.

Check whether month names should be capitalized. I know they should in English and they must not in French. I noticed some languages used capitalization but the output of date differs. Please check and let me know.

2.  The Dates

You can try with your own values by appending a date parameter to the url like this ?date=2004-12-25#doc_chap2. The date will be displayed in the first column.

Lang \ Date 1967-06-05 2004-09-03 2004-10-02 2004-11-01 2004-12-31
bg 5 Юни 1967 3 Септември 2004 2 Октомври 2004 1 Ноември 2004 31 Декември 2004
cs 5. červen 1967 3. září 2004 2. říjen 2004 1. listopad 2004 31. prosinec 2004
da 5. juni 1967 3. september 2004 2. oktober 2004 1. november 2004 31. december 2004
de 5. Juni 1967 3. September 2004 2. Oktober 2004 1. November 2004 31. Dezember 2004
el 5 Ιούνιος 1967 3 Σεπτέμβριος 2004 2 Οκτώβριος 2004 1 Νοέμβριος 2004 31 Δεκέμβριος 2004
en June 5, 1967 September 3, 2004 October 2, 2004 November 1, 2004 December 31, 2004
es 5 de junio, 1967 3 de septiembre, 2004 2 de octubre, 2004 1 de noviembre, 2004 31 de diciembre, 2004
fi 5. kesäkuuta 1967 3. syyskuuta 2004 2. lokakuuta 2004 1. marraskuuta 2004 31. joulukuuta 2004
fr 5 juin 1967 3 septembre 2004 2 octobre 2004 1er novembre 2004 31 décembre 2004
he 5 ביוני, 1967 3 בספטמבר, 2004 2 באוקטובר, 2004 1 בנובמבר, 2004 31 בדצמבר, 2004
hu 1967. június 5. 2004. szeptember 3. 2004. október 2. 2004. november 1. 2004. december 31.
id 5 Juni 1967 3 September 2004 2 Oktober 2004 1 November 2004 31 Desember 2004
it 5 giugno 1967 3 settembre 2004 2 ottobre 2004 1 novembre 2004 31 dicembre 2004
ja 1967年 6月 5日 2004年 9月 3日 2004年 10月 2日 2004年 11月 1日 2004年 12月 31日
ko 1967년 6월 5일 2004년 9월 3일 2004년 10월 2일 2004년 11월 1일 2004년 12월 31일
lt 1967 birželio 5 2004 rugsėjo 3 2004 spalio 2 2004 lapkričio 1 2004 gruodžio 31
nl 5 juni 1967 3 september 2004 2 oktober 2004 1 november 2004 31 december 2004
pl 5 czerwca 1967 3 września 2004 2 października 2004 1 listopada 2004 31 grudnia 2004
pt_br 5 de junho de 1967 3 de setembro de 2004 2 de outubro de 2004 1 de novembro de 2004 31 de dezembro de 2004
ro 5 Iunie 1967 3 Septembrie 2004 2 Octombrie 2004 1 Noiembrie 2004 31 Decembrie 2004
ru 5 июня 1967 3 сентября 2004 2 октября 2004 1 ноября 2004 31 декабря 2004
sr 5. Jun 1967 3. Septembar 2004 2. Oktobar 2004 1. Novembar 2004 31. Decembar 2004
sv 5 juni 1967 3 september 2004 2 oktober 2004 1 november 2004 31 december 2004
tr 5 Haziran 1967 3 Eylül 2004 2 Ekim 2004 1 Kasım 2004 31 Aralık 2004
vi 5 Tháng sáu 1967 3 Tháng chín 2004 2 Tháng mười 2004 1 Tháng mười một 2004 31 Tháng mười hai 2004
zh_cn 1967年 6月 5日 2004年 9月 3日 2004年 10月 2日 2004年 11月 1日 2004年 12月 31日
zh_tw 1967年 6月 5日 2004年 9月 3日 2004年 10月 2日 2004年 11月 1日 2004年 12月 31日


Print

Page updated November 1, 2014

Summary: This page shows how dates are formatted for each language

Xavier * Neys
Author

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.