当前位置: 首页>>代码示例>>PHP>>正文


PHP Date_Calc::nextDayOfWeek方法代码示例

本文整理汇总了PHP中Date_Calc::nextDayOfWeek方法的典型用法代码示例。如果您正苦于以下问题:PHP Date_Calc::nextDayOfWeek方法的具体用法?PHP Date_Calc::nextDayOfWeek怎么用?PHP Date_Calc::nextDayOfWeek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Date_Calc的用法示例。


在下文中一共展示了Date_Calc::nextDayOfWeek方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getWeekNInMonth

 /**
  * Returns the number of the week in the month, given a date
  * @param int year (2003)
  * @param int month (9)
  * @param int day (4)
  * @param int first day of the week (default: monday)
  * @return int week number
  * @access protected
  */
 function getWeekNInMonth($y, $m, $d, $firstDay = 1)
 {
     $weekEnd = $firstDay == 0 ? $this->getDaysInWeek() - 1 : $firstDay - 1;
     $end_of_week = (int) Date_Calc::nextDayOfWeek($weekEnd, 1, $m, $y, '%e', true);
     $w = 1;
     while ($d > $end_of_week) {
         ++$w;
         $end_of_week += $this->getDaysInWeek();
     }
     return $w;
 }
开发者ID:BackupTheBerlios,项目名称:phpalmanac-svn,代码行数:20,代码来源:PearDate.php

示例2: nextDayOfWeekOnOrAfter

 /**
  * Returns date of the next specific day of the week
  * on or before the given date.
  *
  * @param int day of week, 0=Sunday
  * @param string year in format CCYY, default current local year
  * @param string month in format MM, default current local month
  * @param string day in format DD, default current local day
  * @param string format for returned date
  *
  * @access public
  *
  * @return string date in given format
  */
 function nextDayOfWeekOnOrAfter($dow, $day = "", $month = "", $year = "", $format = "%Y%m%d")
 {
     return Date_Calc::nextDayOfWeek($dow, $day = "", $month = "", $year = "", $format = "%Y%m%d", true);
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:18,代码来源:Calc.php

示例3: nextDayOfWeekOnOrAfter

 /**
  * Returns date of the next specific day of the week
  * on or after the given date
  *
  * @param int    $dow    the day of the week (0 = Sunday)
  * @param int    $day    the day of the month, default is current local day
  * @param int    $month  the month, default is current local month
  * @param int    $year   the year in four digit format, default is current
  *                        local year
  * @param string $format the string indicating how to format the output
  *
  * @return   string     the date in the desired format
  * @access   public
  * @static
  */
 function nextDayOfWeekOnOrAfter($dow, $day = 0, $month = 0, $year = null, $format = DATE_CALC_FORMAT)
 {
     return Date_Calc::nextDayOfWeek($dow, $day, $month, $year, $format, true);
 }
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:19,代码来源:Calc.php

示例4: getSummerTimeLimitDay

 /**
  * Returns day on which Summer time starts or ends for given year
  *
  * The limit (start or end) code can take the following forms:
  *  5                 the fifth of the month
  *  lastSun           the last Sunday in the month
  *  lastMon           the last Monday in the month
  *  Sun>=8            first Sunday on or after the 8th
  *  Sun<=25           last Sunday on or before the 25th
  *
  * @param string $ps_summertimelimitcode code which specifies Summer time
  *                                        limit day
  * @param int    $pn_month               start or end month
  * @param int    $pn_year                year for which to calculate Summer
  *                                        time limit day
  *
  * @return   int
  * @access   private
  * @since    Method available since Release 1.5.0
  */
 function getSummerTimeLimitDay($ps_summertimelimitcode, $pn_month, $pn_year)
 {
     if (preg_match('/^[0-9]+$/', $ps_summertimelimitcode)) {
         $hn_day = $ps_summertimelimitcode;
     } else {
         if (!isset($ha_daysofweek)) {
             static $ha_daysofweek = array("Sun" => 0, "Mon" => 1, "Tue" => 2, "Wed" => 3, "Thu" => 4, "Fri" => 5, "Sat" => 6);
         }
         if (preg_match('/^last(Sun|Mon|Tue|Wed|Thu|Fri|Sat)$/', $ps_summertimelimitcode, $ha_matches)) {
             list($hn_nmyear, $hn_nextmonth, $hn_nmday) = explode(" ", Date_Calc::beginOfMonthBySpan(1, $pn_month, $pn_year, "%Y %m %d"));
             list($hn_year, $hn_month, $hn_day) = explode(" ", Date_Calc::prevDayOfWeek($ha_daysofweek[$ha_matches[1]], $hn_nmday, $hn_nextmonth, $hn_nmyear, "%Y %m %d", false));
             // not including
             // this day
             if ($hn_month != $pn_month) {
                 // This code happen legitimately if the calendar jumped some days
                 // e.g. in a calendar switch, or the limit day is badly defined:
                 //
                 $hn_day = Date_Calc::getFirstDayOfMonth($pn_month, $pn_year);
             }
         } else {
             if (preg_match('/^(Sun|Mon|Tue|Wed|Thu|Fri|Sat)([><]=)([0-9]+)$/', $ps_summertimelimitcode, $ha_matches)) {
                 if ($ha_matches[2] == "<=") {
                     list($hn_year, $hn_month, $hn_day) = explode(" ", Date_Calc::prevDayOfWeek($ha_daysofweek[$ha_matches[1]], $ha_matches[3], $pn_month, $pn_year, "%Y %m %d", true));
                     // including
                     // this day
                     if ($hn_month != $pn_month) {
                         $hn_day = Date_Calc::getFirstDayOfMonth($pn_month, $pn_year);
                     }
                 } else {
                     list($hn_year, $hn_month, $hn_day) = explode(" ", Date_Calc::nextDayOfWeek($ha_daysofweek[$ha_matches[1]], $ha_matches[3], $pn_month, $pn_year, "%Y %m %d", true));
                     // including
                     // this day
                     if ($hn_month != $pn_month) {
                         $hn_day = Date_Calc::daysInMonth($pn_month, $pn_year);
                     }
                 }
             }
         }
     }
     return $hn_day;
 }
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:61,代码来源:TimeZone.php

示例5: nextDayOfWeekOnOrAfter

 /**
  * Returns date of the next specific day of the week
  * on or after the given date.
  *
  * @param int day of week, 0=Sunday
  * @param string day in format DD, default is current local day
  * @param string month in format MM, default is current local month
  * @param string year in format CCYY, default is current local year
  * @param string format for returned date
  *
  * @access public
  *
  * @return string date in given format
  */
 function nextDayOfWeekOnOrAfter($dow, $day = '', $month = '', $year = '', $format = '%Y%m%d')
 {
     return Date_Calc::nextDayOfWeek($dow, $day, $month, $year, $format, true);
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:18,代码来源:Calc.php

示例6: MakeRecurrences

 public function MakeRecurrences()
 {
     global $_EV_CONF;
     $days_on = $this->event->rec_data['listdays'];
     $occurrence = $this->dt_start;
     $num_intervals = count($days_on);
     $last_interval = $days_on[$num_intervals - 1];
     // Start by reducing the starting date by one day. Then the for
     // loop can handle all the events.
     list($y, $m, $d) = explode('-', $occurrence);
     $occurrence = Date_Calc::prevDay($d, $m, $y);
     $count = 1;
     while ($occurrence <= $this->event->rec_data['stop'] && $occurrence >= '1971-01-01' && $count < $_EV_CONF['max_repeats']) {
         foreach ($days_on as $dow) {
             list($y, $m, $d) = explode('-', $occurrence);
             $occurrence = Date_Calc::nextDayOfWeek($dow - 1, $d, $m, $y);
             // Stop when we hit the stop date
             if ($occurrence > $this->event->rec_data['stop']) {
                 break;
             }
             $this->storeEvent($occurrence);
             $count++;
             if ($count > $_EV_CONF['max_repeats']) {
                 break;
             }
         }
         // foreach days_on
         if ($this->freq > 1) {
             // Get the beginning of this week, and add $freq weeks to it
             $occurrence = Date_Calc::beginOfWeek($d + 7 * $this->freq, $m, $y);
         }
     }
     // while not at stop date
     return $this->events;
 }
开发者ID:matrox66,项目名称:evlist,代码行数:35,代码来源:evRecur.class.php

示例7: compare

compare('20001121', Date_Calc::prevDay(22, 11, 2000), 'prevDay str');
compare('20001123', Date_Calc::nextDay('22', '11', '2000'), 'nextDay str');
compare('20001117', Date_Calc::prevWeekday('19', '11', '2000'), 'prevWeekday 1 str');
compare('20001117', Date_Calc::prevWeekday(19, 11, 2000), 'prevWeekday 1');
compare('20001121', Date_Calc::prevWeekday(22, 11, 2000), 'prevWeekday 2');
compare('20001123', Date_Calc::nextWeekday(22, 11, 2000), 'nextWeekday 1');
compare('20001127', Date_Calc::nextWeekday(24, 11, 2000), 'nextWeekday 2');
compare('20001127', Date_Calc::nextWeekday('24', '11', '2000'), 'nextWeekday 2 str');
compare('20001121', Date_Calc::prevDayOfWeek('2', '22', '11', '2000'), 'prevDayOfWeek 1 str');
compare('20001121', Date_Calc::prevDayOfWeek(2, 22, 11, 2000), 'prevDayOfWeek 1');
compare('20001115', Date_Calc::prevDayOfWeek(3, 22, 11, 2000), 'prevDayOfWeek 2');
compare('20001122', Date_Calc::prevDayOfWeek(3, 22, 11, 2000, '%Y%m%d', true), 'prevDayOfWeek 3');
compare('20001122', Date_Calc::nextDayOfWeek(3, 22, 11, 2000, '%Y%m%d', true), 'nextDayOfWeek 1');
compare('20001129', Date_Calc::nextDayOfWeek(3, 22, 11, 2000), 'nextDayOfWeek 2');
compare('20001123', Date_Calc::nextDayOfWeek(4, 22, 11, 2000), 'nextDayOfWeek 3');
compare('20001123', Date_Calc::nextDayOfWeek('4', '22', '11', '2000'), 'nextDayOfWeek 3 str');
compare('20001121', Date_Calc::prevDayOfWeekOnOrBefore('2', '22', '11', '2000'), 'prevDayOfWeekOnOrBefore 1 str');
compare('20001121', Date_Calc::prevDayOfWeekOnOrBefore(2, 22, 11, 2000), 'prevDayOfWeekOnOrBefore 1');
compare('20001122', Date_Calc::prevDayOfWeekOnOrBefore(3, 22, 11, 2000), 'prevDayOfWeekOnOrBefore 2');
compare('20001122', Date_Calc::nextDayOfWeekOnOrAfter(3, 22, 11, 2000), 'nextDayOfWeekOnOrAfter 1');
compare('20001123', Date_Calc::nextDayOfWeekOnOrAfter(4, 22, 11, 2000), 'nextDayOfWeekOnOrAfter 2');
compare('20001123', Date_Calc::nextDayOfWeekOnOrAfter('4', '22', '11', '2000'), 'nextDayOfWeekOnOrAfter 2 str');
compare('20001120', Date_Calc::beginOfWeek('22', '11', '2000'), 'beginOfWeek str');
compare('20001120', Date_Calc::beginOfWeek(22, 11, 2000), 'beginOfWeek');
compare('20001126', Date_Calc::endOfWeek(22, 11, 2000), 'endOfWeek');
compare('20001126', Date_Calc::endOfWeek('22', '11', '2000'), 'endOfWeek str');
compare('20001113', Date_Calc::beginOfPrevWeek(22, 11, 2000), 'beginOfPrevWeek');
compare('20001127', Date_Calc::beginOfNextWeek(22, 11, 2000), 'beginOfNextWeek');
compare('20001113', Date_Calc::beginOfPrevWeek('22', '11', '2000'), 'beginOfPrevWeek str');
compare('20001127', Date_Calc::beginOfNextWeek('22', '11', '2000'), 'beginOfNextWeek str');
compare('20001101', Date_Calc::beginOfMonth(11, 2000), 'beginOfMonth');
开发者ID:MagnusA,项目名称:Date,代码行数:31,代码来源:calc.php


注:本文中的Date_Calc::nextDayOfWeek方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。