com web/php: Fixed relTime function, wrong format specifiers in DateInterval::format were used.: include/shared-manual.inc
| From: | Sherif Ramadan | Date: | Thu, 13 Dec 2012 16:16:34 +0000 |
| Subject: | com web/php: Fixed relTime function, wrong format specifiers in DateInterval::format were used.: include/shared-manual.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15071@lists.php.net to get a copy of this message | ||
Commit: a5612288e63edec8577743e5d9a0ed5956c990ae
Author: Sherif Ramadan <googleguy@php.net> Thu, 13 Dec 2012 11:16:34 -0500
Parents: 3d109b91788e8ad7252df4ea6716111191068eee
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=a5612288e63edec8577743e5d9a0ed5956c990ae
Log:
Fixed relTime function, wrong format specifiers in DateInterval::format were used.
Changed paths:
M include/shared-manual.inc
Diff:
diff --git a/include/shared-manual..inc b/include/shared-manual.inc
index 76bed6b..8058c4e 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -654,10 +654,10 @@ function relTime(DateTime $date) {
$diff = $current->diff($date);
$units = array("year" => $diff->format("%y"),
"month" => $diff->format("%m"),
- "day" => $diff->format("%m"),
- "hour" => $diff->format("%m"),
- "minute" => $diff->format("%m"),
- "second" => $diff->format("%m"),
+ "day" => $diff->format("%d"),
+ "hour" => $diff->format("%h"),
+ "minute" => $diff->format("%i"),
+ "second" => $diff->format("%s"),
);
$out = "just now...";
foreach ($units as $unit => $amount) {