Jelix 1.8.13

modifier.datetime.php

Tags
subpackage

jtpl_plugin

author

Laurent Jouanneau

contributor

Philippe Villiers

copyright

2012 Laurent Jouanneau

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_datetime()  : string
modifier plugin : change the format of a date.

Functions

jtpl_modifier_common_datetime()

modifier plugin : change the format of a date.

jtpl_modifier_common_datetime(string $date[, string $format_out = 'lang_datetime' ][, string $format_in = '' ]) : string

The date can be given as a string, or as a DateTime object.

It uses DateTime to convert a date. It takes two optionnal arguments. The first one is the format of the output date. It should be a format understood by DateTime, or one of this format identifier: 'lang_date', 'lang_datetime', 'lang_time', 'lang_long_datetime'. By default, it use the locale datetime format. The second one is the format of the given date, if the date format is not understood by DateTime.

examples : {$mydate|datetime} {$mydate|datetime:'dd/mm/YY'}

Parameters
$date : string

the date

$format_out : string = 'lang_datetime'

the format identifier of the output date

$format_in : string = ''

the format identifier of the given date

Tags
see
jDateTime
Return values
string

the converted date

Search results