<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                > DateTimeImmutable類是 PHP 5.5后新增的處理時間格式類,該類與DateTime相同,只是它從不修改自己,而是返回一個新對象。 > DateTimeImmutable類繼承了DateTimeInterface接口,因此需要實現該接口中的六個方法,以及繼承了該接口中定義的13個預定義常量。 ``` // 類中包含的方法 public __construct ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] ) public add ( DateInterval $interval ) : DateTimeImmutable public static createFromFormat ( string $format , string $time [, DateTimeZone $timezone ] ) : DateTimeImmutable public static createFromMutable ( DateTime $datetime ) : DateTimeImmutable public static getLastErrors ( void ) : array public modify ( string $modify ) : DateTimeImmutable public static __set_state ( array $array ) : DateTimeImmutable public setDate ( int $year , int $month , int $day ) : DateTimeImmutable public setISODate ( int $year , int $week [, int $day = 1 ] ) : DateTimeImmutable public setTime ( int $hour , int $minute [, int $second = 0 [, int $microseconds = 0 ]] ) : DateTimeImmutable public setTimestamp ( int $unixtimestamp ) : DateTimeImmutable public setTimezone ( DateTimeZone $timezone ) : DateTimeImmutable public sub ( DateInterval $interval ) : DateTimeImmutable public diff ( DateTimeInterface $datetime2 [, bool $absolute = FALSE ] ) : DateInterval public format ( string $format ) : string public getOffset ( void ) : int public getTimestamp ( void ) : int public getTimezone ( void ) : DateTimeZone public __wakeup ( void ) ``` ``` // 以add方法為例 $interval = new DateInterval('P2W'); //P2W 表示兩周,14天 $datetime = new DateTime('2019-07-14 14:00:00'); $datetime->add($interval);// 加14天 // DateTime類會直接修改$datetime對象 dump($datetime); object(DateTime)#227 (3) { ["date"] => string(26) "2019-07-28 14:00:00.000000" ["timezone_type"] => int(3) ["timezone"] => string(13) "Asia/Shanghai" } $date_immutable = new DateTimeImmutable('2019-07-14 14:00:00'); $date_immutable_new = $date_immutable->add($interval); // DateTimeImmutable類沒有修改自己的實例化對象,而是返回一個新的對象 // 因此打印$date_immutable對象,還是顯示修改之前的值 dump($date_immutable); object(DateTimeImmutable)#226 (3) { ["date"] => string(26) "2019-07-14 14:00:00.000000" ["timezone_type"] => int(3) ["timezone"] => string(13) "Asia/Shanghai" } // 新的對象$date_immutable_new為更改后的值 dump($date_immutable_new); object(DateTimeImmutable)#225 (3) { ["date"] => string(26) "2019-07-28 14:00:00.000000" ["timezone_type"] => int(3) ["timezone"] => string(13) "Asia/Shanghai" } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看