From 89eb4509c0f70d5dfd1df5a923ba1a40f286678a Mon Sep 17 00:00:00 2001 From: boots Date: Wed, 10 Jan 2007 18:12:11 +0000 Subject: [PATCH] fix handling of %I with mysql timestamps Thanks to Danilo Buerger --- NEWS | 2 ++ libs/plugins/modifier.date_format.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 953294e9..b1e10ef8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- fix handling of %I with mysql timestamps in the date_format modifier + (Danilo Buerger, boots) - update smarty_core_write_file() to better recognize Windows (boots) - emulate %R in the date_format modifier on Windows (Danilo Buerger, boots) diff --git a/libs/plugins/modifier.date_format.php b/libs/plugins/modifier.date_format.php index 1234af2f..8c85a7e9 100644 --- a/libs/plugins/modifier.date_format.php +++ b/libs/plugins/modifier.date_format.php @@ -31,7 +31,7 @@ require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null) { if (substr(PHP_OS,0,3) == 'WIN') { - $hours = strftime('%I', $string); + $hours = strftime('%I', smarty_make_time_stamp($string)); $short_hours = ( $hours < 10 ) ? substr( $hours, -1) : $hours; $_win_from = array ('%e', '%T', '%D', '%l', '%R'); $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y', $short_hours, '%H:%M');