getDateTime.gp



Creator information
Current maintainer :David Massart
Author(s) :David Massart
Thanks to originator of stolen code: Karl Heinz Kremer
Recipe homepage :David Massart's Home Page

Version history
getDateTime 1.1 (internationalization: currently English, French, German, Spanish, and Dutch)
getDateTime 1.01 (fix a problem with extra blank space before day 1 to 9)
getDateTime 1.0 (first public release)
Overview
getDateTime.gp is a replacement for Karl Heinz Kremer's getModTime.gp. It let a user define a format for the modification time and/or date of the source file and insert it into the output file. getDateTime.gp provides internationalization for the following languages: English, French, Dutch, German, and Spanish.
Compatible Genpage Versions
1.0.6
Syntax
getDateTime( aPath[, aFormat[, aLanguage]] )

where:

Available masks for format are:

WD  : WeekDay      (ex: Wed for Wednesday)
LWD : Long WeekDay (ex: Wednesday)
DD  : Day          (ex: 29 as in September the 29th)
MM  : Month        (ex: Sep for September)
SM  : Short Month  (ex: 9 for September)
LM  : Long Month   (ex: September)
YYYY: Year         (ex: 1999)
YY  : Year         (ex: 99)
hh  : hour         (ex: 16 for 4pm)
mm  : minutes      (ex: 14)
ss  : secs         (ex: 17)

Available language codes are:

EN for English (default)
FR for French  (Français)
NL for Dutch   (Nederlands)
DE for German  (Deutsch)
ES for Spanish (Español)

Examples
Firstly, include the getDateTime.gp recipe by calling <-- _GP_ recipe("$root/include/getDateTime.gp") --> somewhere in the content, that can be either in one of the content files or in the template file.

Every time the getDateTime($inputfile, aFormat, aLanguage) statement is found, genpage will format the modification date and/or time of the source file and insert it into the generated file.

Here are some possible formats:
"WD MM DD hh:mm:ss YYYY" -> Wed Sep 29 16:14:17 1999 (default format)
"DD/SM/YYYY" -> 29/9/1999
"Last Modified on LWD LM DD, YYYY" -> Last Modified on Wednesday September 29, 1999
"Dernière modification le LWD DD LM YYYY", "FR" -> Dernière modification le mercredi 29 septembre 1999


To-do List
Add support for new languages
Known Bugs
No bugs known yet.

Back to Top


This page generated using Genpage - Version: 1.0.7 on Wed Nov 30 16:34:11 2016

© David Massart
Thanks to originator of stolen code: Karl Heinz Kremer 1999