Exemplo n.º 1
0
 /**
  * Support all JevDate::strftime() parameter for Window systems
  *
  * @param string $format
  * @param int $timestamp
  * @return string formated string
  */
 function jev_strftime($format = '', $timestamp = null)
 {
     if (!$timestamp) {
         $timestamp = time();
     }
     // Replace names by own translation to get rid of improper os system library
     if (strpos($format, '%a') !== false) {
         $format = str_replace('%a', JEVHelper::getShortDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%A') !== false) {
         $format = str_replace('%A', JEVHelper::getDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%b') !== false) {
         $format = str_replace('%b', JEVHelper::getShortMonthName(date('n', $timestamp)), $format);
     }
     if (strpos($format, '%B') !== false) {
         $format = str_replace('%B', JEVHelper::getMonthName(date('n', $timestamp)), $format);
     }
     if (JUtility::isWinOS()) {
         if (!class_exists('JEV_CompatWin')) {
             require_once dirname(__FILE__) . '/compatwin.php';
         }
         return JEV_CompatWin::win_strftime($format, $timestamp);
     } else {
         return JevDate::strftime($format, $timestamp);
     }
 }