imScript Manual


Date tags

« Back  |  Next »
Introduction
General information
Text field
Image field
Page information
Links & Menu
Include
Data tags
User data
Date tags
Velocity
API samples
JSP
imScript tags list
RSS feed
<?imcms:datetime?> - Use to display the date in specified format. The result will have the following look:

2005-10-17 18:00

Attributes:

  • format
  • type
  • lang

Format - attribute

Use to specify date format to be displayed in. It is possible to specify your own data format according to the standard for data formats in Java.
Date format is consists of letter combinations and configures the date and time output.

  • yyyy displays year with four figures
  • yy displays year with two figures
  • MMMM displays the month's names in full length (February)
  • MMM displays the short variant of the month's names (Feb)
  • MM displays the month with two figures (02)
  • M displays the month with one or two figures (1-12).

Examples:

Tag Result
<?imcms:datetime format='yyyy-MM-dd'?> 2005-10-17
<?imcms:datetime format='MMM dd yy'?> okt 17 2005
<?imcms:datetime format='"the" dd MMMM yyyy'?> the 17 October 2005
<?imcms:datetime format='"Time is" hh:ss a'?> Time is 05:27 PM
<?imcms:datetime format='yy/MM/dd "hr." HH:ss'?> 05/10/17 kl. 17:27
<?imcms:datetime format='d/M-yyyy'?> 17/10-2005
<?imcms:datetime format='E d/M'?> mo 17/10
<?imcms:datetime format='EEEE "the" d MMMM yyyy'?> Monday the 17 October 2005
<?imcms:datetime format='yyyy.MM.dd "at" hh: mm:ss'?> 2005.10.17 AD at 05:08:27 PM
Central european time

Type - attribute

This attribute controls the type of date you need to display.
Possible values are:

  • now (default, if type attribute does not specified)
  • created – document creation time
  • modified – last modification date
  • archived – archiving date
  • activated – date, when current document has been activated

It is not necessary to write full name value in attribute. The system will recognize the value meaning by first letters. So type=”n” means new, “ar” – archived, “ac” – activated, and etc.

Examples:

<?imcms:datetime type='n'?>
<?imcms:datetime type='c'?>
<?imcms:datetime type='m'?>
<?imcms:datetime type='ac'?>
<?imcms:datetime type='ar'?>

Lang - attribute

Use to display date in other language than the system use. There you can specify value according to the standard for data formats in Java (Locale class). Value sets by two letter combination that corresponds the country main language.

Examples:

<?imcms:datetime format="EEEE d MMMM yyyy" lang="sv"?> - måndag 17 oktober 2005 (Swedish)
<?imcms:datetime format="EEEE d MMMM yyyy" lang="fi"?> - maanantai 17 lokakuu 2005 (Finish)
<?imcms:datetime format="EEEE d MMMM yyyy" lang="en"?> - Monday 17 October 2005 (English)

[Help for the whole system | imScript manual | All documentation]

Suggestions or comments? Please send us a mail: info@imcode.com