Beispiel #1
0
 public static function getFormattedTime($time, $format, $offset = 0)
 {
     $time = strtotime($time);
     // Manually modify the month and day strings in the format.
     if (strpos($format, '%a') !== false) {
         $format = str_replace('%a', CTimeHelper::dayToString(date('w', $time), true), $format);
     }
     if (strpos($format, '%A') !== false) {
         $format = str_replace('%A', CTimeHelper::dayToString(date('w', $time)), $format);
     }
     if (strpos($format, '%b') !== false) {
         $format = str_replace('%b', CTimeHelper::monthToString(date('n', $time), true), $format);
     }
     if (strpos($format, '%B') !== false) {
         $format = str_replace('%B', CTimeHelper::monthToString(date('n', $time)), $format);
     }
     return strftime($format, $time);
 }