Exemple #1
0
 /**
  * Converts a string representing the format for the function strftime and returns a
  * windows safe and i18n aware format.
  *
  * @param string $format Format with specifiers for strftime function.
  *    Accepts the special specifier %S which mimics the modifier S for date()
  * @param string $time UNIX timestamp
  * @return string windows safe and date() function compatible format for strftime
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
  */
 public static function convertSpecifiers($format, $time = null)
 {
     if (!$time) {
         $time = time();
     }
     self::$_time = $time;
     return preg_replace_callback('/\\%(\\w+)/', array('CakeTime', '_translateSpecifier'), $format);
 }