Jelix 1.8.14-pre

modifier.jdatetime.php

Tags
subpackage

jtpl_plugin

author

Laurent Jouanneau

contributor

Emmanuel Hesry, Julien Issler, Briceg

copyright

2006 Laurent Jouanneau

copyright

2009 Emmanuel Hesry

copyright

2010 Julien Issler, 2011 Briceg

see
http://www.jelix.org
licence

GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html

Table of Contents

jtpl_modifier_common_jdatetime()  : string
modifier plugin : change the format of a date.

Functions

jtpl_modifier_common_jdatetime()

modifier plugin : change the format of a date.

jtpl_modifier_common_jdatetime(string $date[, string $format_in = 'db_datetime' ][, string $format_out = 'lang_date' ]) : string

It uses jDateTime to convert a date. It takes two optionnal arguments. The first one is the format identifier of the given date (by default, it is db_datetime). The second one is the format identifier of the output date (by default, it is lang_date).

Availabled format identifiers are (with the equivalent constant of jDateTime) :

  • 'lang_date' (jDateTime::LANG_DFORMAT)
  • 'lang_datetime' => jDateTime::LANG_DTFORMAT)
  • 'lang_time' => jDateTime::LANG_TFORMAT)
  • 'db_date' => jDateTime::DB_DFORMAT)
  • 'db_datetime' => jDateTime::DB_DTFORMAT)
  • 'db_time' => jDateTime::DB_TFORMAT)
  • 'iso8601' => jDateTime::ISO8601_FORMAT)
  • 'timestamp' => jDateTime::TIMESTAMP_FORMAT)
  • 'rfc822'=> jDateTime::RFC822_FORMAT)
  • 'full_lang_date'=> jDateTime::FULL_LANG_DATE

examples : {$mydate|jdatetime} {$mydate|jdatetime:'db_time':'lang_time'}

Parameters
$date : string

the date

$format_in : string = 'db_datetime'

the format identifier of the given date

$format_out : string = 'lang_date'

the format identifier of the output date

Tags
throws
jException
see
jDateTime
Return values
string

the converted date

Search results