SPIP-Contrib

SPIP-Contrib

عربي | Deutsch | English | Español | français | italiano

273 Plugins, 191 contribs On SPIP-Zone, 39 visitors now

Homepage > Envents & calendar > Formats de dates > Alternative English date formats

Alternative English date formats

25 April 2005 – by paolo

All the versions of this article: [English] [français]

Making a language file to display English dates in an alternative format.

SPIP date tags such as [(#DATE|affdate)] display dates in English in this format: 23 September 2006

This is—inasmuch as any standard exists—correct British usage:

“Dates should be shown in the order day, month, year, without internal punctuation, as: 2 November 1993. A named day preceding a date is separated by a comma: Tuesday, 2 November 1993. There is no comma between month and year. (...) In US style the order is month, day, year: November 2, 1993 (...) Do not use the endings ‘st’, ‘rd’ or ‘th’ in conjunction with a figure.”
(Oxford Guide to Style pp. 178-9, Oxford University Press, 2002)

But it is not difficult to change!

SPIP 1.8 allows for local language files (in this case, a file named local_en.php3) to override the default language texts.

American format

Here are the necessary lines for such a file to give dates in American format (i.e. September 23; September 23, 2006):

Alternative British format

Even if the Oxford Guide to Style suggests you shouldn’t, some people like ‘st’, ‘th’, etc. in their dates. Well, you can get them by using these lines:

Instructions

If you want Spip tags to display with one of these alternative formats then:

  1. Create a file called local_en.php3. [1]
  2. Copy the lines of the format you choose (all the lines, from <?php to ?> included) into the file.
  3. Place the file in your templates directory, or in the root of the site, or in the ecrire/lang/ directory of your site.

Footnotes

[1If you are already using a local_en.php3 file, then integrate the lines above without repeating the first 3 or the last 2 lines of code.

Back to top

Comment on this article

Who are you?
  • [Log in]

To show your avatar with your message, register it first on gravatar.com (free et painless) and don't forget to indicate your Email addresse here.

Enter your comment here Les choses à faire avant de poser une question (Prolégomènes aux rapports de bugs. )
Add a document

Back to top

Here they're talking

  • (fr) Typographie avancée

    3 mars 2010 – <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    « Typographie avancée » active automatiquement un grand nombre d’automatismes destinés à affiner la typographie des textes produits par SPIP. Nécessite PHP 5 au minimum. « Typographie avancée » est l’adaptation, pour SPIP, de la classe « PHP Typography », (...)

  • (fr) Plugin Convertisseur

    24 février 2008 – 15 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Convertit différents formats d’articles (wiki, docx, pdf, etc..). en format SPIP (texte avec les raccourcis typographiques SPIP)

  • (fr) Thèmes pour l’interface privée

    22 février 2010 – <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Un sélecteur d’interfaces graphiques pour l’espace privé de SPIP 2.1. Une petite collection d’interfaces est livrée avec le plugin. Ce plugin permet à chaque participant à l’espace privé de sélectionner sa propre interface graphique en fonction de ses (...)

  • (fr) Albums

    8 novembre 2011 – 29 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Ce plugin permet d’afficher une ou plusieurs galeries d’images au fil du texte, dans les articles et ailleurs. Qui rédige un récit de voyage, par exemple, aimerait pouvoir illustrer son article de plusieurs petites séries de photos, une par jour. Or (...)

  • (fr) Navigation AJAX

    31 janvier – 17 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Ce plugin permet de modifier automatiquement une parties des liens internes de manière à ce qu’ils ne déclenchent pas un chargement complet de la page cible, mais un chargement en AJAX de certains éléments spécifiés à l’avance. Il permet aussi de (...)