Skip to content
Browse files

change date format on list

  • Loading branch information...
1 parent 1dfb4a0 commit c06c3d1f0fb4ac7de704536e9fd28217d4511f10 @thomaspark committed Sep 19, 2012
Showing with 19 additions and 18 deletions.
  1. +19 −18 list-home-code.php
View
37 list-home-code.php
@@ -6,24 +6,25 @@ function plural($num) {
function getRelativeTime($date) {
$time = @strtotime($date);
- $diff = time() - $time;
- if ($diff<60)
- return $diff . " second" . plural($diff) . " ago";
- $diff = round($diff/60);
- if ($diff<60)
- return $diff . " minute" . plural($diff) . " ago";
- $diff = round($diff/60);
- if ($diff<24)
- return $diff . " hour" . plural($diff) . " ago";
- $diff = round($diff/24);
- if ($diff<7)
- return $diff . " day" . plural($diff) . " ago";
- $diff = round($diff/7);
- if ($diff<4)
- return $diff . " week" . plural($diff) . " ago";
- if (date('Y', $time) != date('Y', time()))
- return date("j-M Y", $time);
- return date("j-M", $time);
+ // $diff = time() - $time;
+ // if ($diff<60)
+ // return $diff . " second" . plural($diff) . " ago";
+ // $diff = round($diff/60);
+ // if ($diff<60)
+ // return $diff . " minute" . plural($diff) . " ago";
+ // $diff = round($diff/60);
+ // if ($diff<24)
+ // return $diff . " hour" . plural($diff) . " ago";
+ // $diff = round($diff/24);
+ // if ($diff<7)
+ // return $diff . " day" . plural($diff) . " ago";
+ // $diff = round($diff/7);
+ // if ($diff<4)
+ // return $diff . " week" . plural($diff) . " ago";
+ // if (date('Y', $time) != date('Y', time()))
+ // return date("j-M Y", $time);
+ // return date("j-M", $time);
+ return date("n/j/y h:i a", $time);
}
?>
<!DOCTYPE html>

0 comments on commit c06c3d1

Please sign in to comment.
Something went wrong with that request. Please try again.