Source for file date_format.php
Documentation is available at date_format.php
* * value : the date, as a unix timestamp, mysql datetime or whatever strtotime() can parse
* * format : output format, see {@link http://php.net/strftime} for details
* * default : a default timestamp value, if the first one is empty
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
// convert if it's not a valid unix timestamp
} elseif (!empty($default)) {
// convert if it's not a valid unix timestamp
// Credits for that windows compat block to Monte Ohrt who made smarty's date_format plugin
if (DIRECTORY_SEPARATOR ==
'\\') {
$_win_from =
array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
$_win_to =
array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
if (strpos($format, '%e') !==
false) {
if (strpos($format, '%l') !==
false) {
Documentation generated on Sun, 07 Feb 2010 17:53:32 +0000 by phpDocumentor 1.4.0