[pLog-svn] r1393 - plog/trunk/class/locale

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Wed Mar 9 22:59:12 GMT 2005


Author: jondaley
Date: 2005-03-09 22:59:11 +0000 (Wed, 09 Mar 2005)
New Revision: 1393

Modified:
   plog/trunk/class/locale/locale.class.php
Log:
%I hour format was printing out 1:00 if it was 13:00 and 01:00 if it was 01:00.  It should be consistent, I like it without the zero, but if we would rather add some other letter for without a zero, that is fine.

Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php	2005-03-09 22:37:39 UTC (rev 1392)
+++ plog/trunk/class/locale/locale.class.php	2005-03-09 22:59:11 UTC (rev 1393)
@@ -437,7 +437,7 @@
 		 * <li>%d	day of the month, 2 digits with leading zero</li>
          * <li>%j   day of the month, numeric (without leading zero)</li>
 		 * <li>%H	hours, in 24-h format</li>
-		 * <li>%I	hours, in 12-h format</li>
+		 * <li>%I	hours, in 12-h format (without leading zero)</li>
 		 * <li>%p   returns 'am' or 'pm'</li>
 		 * <li>%P   returns 'AM' or 'PM'</li>
 		 * <li>%M	minutes</li>
@@ -480,7 +480,7 @@
 			$values["%e"] = intval($timeStamp->getDay());
 			$values["%j"] = $timeStamp->getDay();
 			$values["%H"] = $timeStamp->getHour();
-			$values["%I"] = ($timeStamp->getHour() != 0) ? ($timeStamp->getHour() > 12) ? $timeStamp->getHour()-12 : $timeStamp->getHour() : 12;
+			$values["%I"] = ($timeStamp->getHour() != 0) ? ($timeStamp->getHour() > 12) ? $timeStamp->getHour()-12 : $timeStamp->getHour()+0 : 12;
 			$values["%p"] = $timeStamp->getHour() >= 12 ? "pm" : "am";
 			$values["%P"] = $timeStamp->getHour() >= 12 ? "PM" : "AM";
 			$values["%M"] = $timeStamp->getMinutes();




More information about the pLog-svn mailing list