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


PHP Date_Calc::weekOfYear7th方法代码示例

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


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

示例1: weekOfYear

 /**
  * Returns week of the year, where first Sunday is first day of first week
  *
  * N.B. this function is equivalent to calling:
  *
  *  <code>Date_Calc::weekOfYear7th($day, $month, $year, 0)</code>
  *
  * Returned week is an integer from 1 to 53.
  *
  * @param int $pn_day   the day of the month, default is current local day
  * @param int $pn_month the month, default is current local month
  * @param int $pn_year  the year in four digit format, default is current
  *                       local year
  *
  * @return     int        integer from 1 to 53
  * @access     public
  * @static
  * @see        Date_Calc::weekOfYear7th
  * @deprecated Method deprecated in Release 1.5.0
  */
 function weekOfYear($pn_day = 0, $pn_month = 0, $pn_year = null)
 {
     $ha_week = Date_Calc::weekOfYear7th($pn_day, $pn_month, $pn_year, 0);
     return $ha_week[1];
 }
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:25,代码来源:Calc.php

示例2: format2


//.........这里部分代码省略.........
                 //
                 if (strtoupper(substr($ps_format, $i, 2)) == "WW") {
                     $hn_week = Date_Calc::weekOfYearAbsolute($this->day, $this->month, $this->year);
                     $hs_numberformat = substr($ps_format, $i + 2, 4);
                     $hs_week = $this->_formatNumber($hn_week, $hs_numberformat, 2, $hb_nopad, true, $ps_locale);
                     if (Pear::isError($hs_week)) {
                         return $hs_week;
                     }
                     $ret .= $hs_week;
                     $i += 2 + strlen($hs_numberformat);
                 } else {
                     if (strtoupper(substr($ps_format, $i, 2)) == "W1") {
                         $hn_week = Date_Calc::weekOfYear1st($this->day, $this->month, $this->year);
                         $hs_numberformat = substr($ps_format, $i + 2, 4);
                         $hs_week = $this->_formatNumber($hn_week, $hs_numberformat, 2, $hb_nopad, true, $ps_locale);
                         if (Pear::isError($hs_week)) {
                             return $hs_week;
                         }
                         $ret .= $hs_week;
                         $i += 2 + strlen($hs_numberformat);
                     } else {
                         if (strtoupper(substr($ps_format, $i, 2)) == "W4") {
                             $ha_week = Date_Calc::weekOfYear4th($this->day, $this->month, $this->year);
                             $hn_week = $ha_week[1];
                             $hs_numberformat = substr($ps_format, $i + 2, 4);
                             $hs_week = $this->_formatNumber($hn_week, $hs_numberformat, 2, $hb_nopad, true, $ps_locale);
                             if (Pear::isError($hs_week)) {
                                 return $hs_week;
                             }
                             $ret .= $hs_week;
                             $i += 2 + strlen($hs_numberformat);
                         } else {
                             if (strtoupper(substr($ps_format, $i, 2)) == "W7") {
                                 $ha_week = Date_Calc::weekOfYear7th($this->day, $this->month, $this->year);
                                 $hn_week = $ha_week[1];
                                 $hs_numberformat = substr($ps_format, $i + 2, 4);
                                 $hs_week = $this->_formatNumber($hn_week, $hs_numberformat, 2, $hb_nopad, true, $ps_locale);
                                 if (Pear::isError($hs_week)) {
                                     return $hs_week;
                                 }
                                 $ret .= $hs_week;
                                 $i += 2 + strlen($hs_numberformat);
                             } else {
                                 // Code 'W':
                                 //
                                 $hn_week = Date_Calc::weekOfMonthAbsolute($this->day, $this->month, $this->year);
                                 $hs_numberformat = substr($ps_format, $i + 1, 4);
                                 $hs_week = $this->_formatNumber($hn_week, $hs_numberformat, 1, $hb_nopad, true, $ps_locale);
                                 if (Pear::isError($hs_week)) {
                                     return $hs_week;
                                 }
                                 $ret .= $hs_week;
                                 $i += 1 + strlen($hs_numberformat);
                             }
                         }
                     }
                 }
                 break;
             case "y":
             case "Y":
                 // Check for 'YEAR' first:
                 //
                 if (strtoupper(substr($ps_format, $i, 4)) == "YEAR") {
                     switch (substr($ps_format, $i, 2)) {
                         case "YE":
                             $hs_spformat = "SP";
开发者ID:,项目名称:,代码行数:67,代码来源:


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