_format = $format; } /** * * display a formatted date * * @param string $date * @param bool $dateOnly * @param string $format * @return string */ public function date($date, $dateOnly = false, $format = null) { if ($date === null) { return 'n/a'; } if (!is_numeric($date)) { $date = strtotime($date); } if ($format === null) { $format = $this->_format; } if ($dateOnly){ $format = trim(str_ireplace('%H:%M:%S', '', $format)); } return strftime($format, $date); } }