/** * Formats a timestamp * * @param $ts * @param $format the output format, blog default will be used if empty * @internal param timestamp $time * @return string the formatted date */ public static function formatTs($ts, $format = null) { $dt = new DateTime(); $dt->setTimestamp($ts); if (empty($format)) { $format = IfwPsn_Wp_Proxy_Blog::getDateFormat() . ' ' . IfwPsn_Wp_Proxy_Blog::getTimeFormat(); } $offset = IfwPsn_Wp_Proxy_Blog::getGmtOffset(); if (empty($offset)) { $offset = 0; } return date($format, $dt->format('U') + $offset * 3600); }