format() публичный Метод

Returns date/time in the given format with months and days translated.
public format ( string $format, string | DateTimeZone $timeZone = null ) : string
$format string Requested format
$timeZone string | DateTimeZone Result time zone definition
Результат string
Пример #1
0
 /**
  * Checks if the given date is a working day.
  *
  * @param \Jyxo\Time\Time $day Date to be checked
  * @return boolean
  */
 public static function isWorkDay(\Jyxo\Time\Time $day)
 {
     $holidays = self::$holidays;
     // Adds Easter Monday. easter_date is supposed to be buggy http://cz.php.net/manual/en/function.easter-date.php#80664
     $year = (int) $day->format('Y');
     $days = easter_days($year);
     // $days returns the number of days from March 21st until the Easter Sunday, +1 because of Monday
     $holidays[] = date('j.n', strtotime($year . '-03-21 +' . ($days + 1) . ' days'));
     $isWorkDay = true;
     if ($day->format('N') > 5) {
         // Saturday or Sunday
         $isWorkDay = false;
     } elseif (in_array($day->format('j.n'), $holidays)) {
         // Public holiday, hurray!
         $isWorkDay = false;
     }
     return $isWorkDay;
 }