date_format : $format; $delta = time()-$gmepoch; if (!isset($datecache[$format])) { // Is the user requesting a friendly date format (i.e. 'Today 12:42')? $datecache[$format] = array( 'shortformat' => strpos($format, '|'), 'zoneoffset' => $this->timezone + $this->dst, 'formatstring_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1), 'formatstring_long' => str_replace('|', '', $format), 'lang_dates' => $this->lang['datetime'], ); } // BartVB Show some date < 1 hour ago as '14 min ago' if ($delta < 3600 && $delta > 0 && $datecache[$format]['shortformat'] !== false) { return floor($delta/60) . " min " . $datecache[$format]['lang_dates']['AGO']; } if (!$midnight) { list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $datecache[$format]['zoneoffset'])); $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $datecache[$format]['zoneoffset']; } if ($datecache[$format]['shortformat'] !== false && !$forcedate) { if ($gmepoch > $midnight + 86400) { $day = 'TOMORROW'; } else if ($gmepoch > $midnight) { $day = 'TODAY'; } else if ($gmepoch > $midnight - 86400) { $day = 'YESTERDAY'; } else { $day = ''; } if ($day != '') { return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($datecache[$format]['formatstring_short'], $gmepoch + $datecache[$format]['zoneoffset']), $datecache[$format]['lang_dates'])); } } /* // Short representation of month in format if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) { $lang_dates['May'] = $lang_dates['May_short']; } //unset($lang_dates['May_short']); */ return strtr(@gmdate($datecache[$format]['formatstring_long'], $gmepoch + $datecache[$format]['zoneoffset']), $datecache[$format]['lang_dates']); } ?>