mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
added explanation of changed behaviour of date_format's parsing
This commit is contained in:
@@ -47,6 +47,24 @@
|
|||||||
formatting of the date. If the date passed to
|
formatting of the date. If the date passed to
|
||||||
<command>date_format</command> is empty and a second parameter is passed,
|
<command>date_format</command> is empty and a second parameter is passed,
|
||||||
that will be used as the date to format.
|
that will be used as the date to format.
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
Since Smarty-2.6.10 numeric values passed to date_format are
|
||||||
|
<emphasis>always</emphasis> (except for mysql timestamps, see
|
||||||
|
below) interpreted as a unix timestamp.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Before Smarty-2.6.10 numeric strings that where also parsable by
|
||||||
|
strtotime() in php (like "YYYYMMDD") where sometimes - depending
|
||||||
|
on the underlying implementation of strtotime() - interpreted as
|
||||||
|
date strings and not as timestamps.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The only exception are mysql timestamps: They are also numeric
|
||||||
|
only and 14 characters long ("YYYYMMDDHHMMSS"). Mysql timestamps
|
||||||
|
have precedence over unix timestamps.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>date_format</title>
|
<title>date_format</title>
|
||||||
|
Reference in New Issue
Block a user