當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Date_Calc::weekOfYearAbsolute方法代碼示例

本文整理匯總了PHP中Date_Calc::weekOfYearAbsolute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Date_Calc::weekOfYearAbsolute方法的具體用法?PHP Date_Calc::weekOfYearAbsolute怎麽用?PHP Date_Calc::weekOfYearAbsolute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Date_Calc的用法示例。


在下文中一共展示了Date_Calc::weekOfYearAbsolute方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: format2


//.........這裏部分代碼省略.........
                                                 $ret .= $hs_tzs;
                                                 $i += 3 + strlen($hs_numberformat);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 break;
             case "u":
             case "U":
                 if ($this->ob_invalidtime) {
                     return $this->_getErrorInvalidTime();
                 }
                 $hn_unixtime = $this->getTime();
                 $hs_numberformat = substr($ps_format, $i + 1, 4);
                 // Allow sign if negative; allow all digits (specify nought);
                 // suppress padding:
                 //
                 $hs_unixtime = $this->_formatNumber($hn_unixtime, $hs_numberformat, 0, true, false, $ps_locale);
                 if (Pear::isError($hs_unixtime)) {
                     return $hs_unixtime;
                 }
                 $ret .= $hs_unixtime;
                 $i += 1 + strlen($hs_numberformat);
                 break;
             case "w":
             case "W":
                 // Check for 'WW' before 'W':
                 //
                 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];
開發者ID:,項目名稱:,代碼行數:67,代碼來源:


注:本文中的Date_Calc::weekOfYearAbsolute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。