欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          如何實現(xiàn)轉(zhuǎn)換php時間戳

          如何實現(xiàn)轉(zhuǎn)換php時間戳

          如何實現(xiàn)轉(zhuǎn)換php時間戳?

          可以使用strtotime()函數(shù)實現(xiàn)轉(zhuǎn)換php時間戳。

          strtotime()定義和用法

          strtotime() 函數(shù)將任何英文文本的日期或時間描述解析為 Unix 時間戳(自 January 1 1970 00:00:00 GMT 起的秒數(shù))。

          注意:如果年份表示使用兩位數(shù)格式,則值 0-69 會映射為 2000-2069,值 70-100 會映射為 1970-2000。

          注意:請注意 m/d/y 或 d-m-y 格式的日期,如果分隔符是斜線(/),則使用美洲的 m/d/y 格式。如果分隔符是橫杠(-)或者點(.),則使用歐洲的 d-m-y 格式。為了避免潛在的錯誤,您應(yīng)該盡可能使用 YYYY-MM-DD 格式或者使用 date_create_from_format() 函數(shù)。

          語法

          strtotime(time,now);

          參數(shù)

          time 必需。規(guī)定日期/時間字符串。

          now 可選。規(guī)定用來計算返回值的時間戳。如果省略該參數(shù),則使用當(dāng)前時間。

          實例

          將英文文本日期時間解析為 Unix 時間戳:

          <?php echo(strtotime("now") . "<br>"); echo(strtotime("15 October 1980") . "<br>"); echo(strtotime("+5 hours") . "<br>"); echo(strtotime("+1 week") . "<br>"); echo(strtotime("+1 week 3 days 7 hours 5 seconds") . "<br>"); echo(strtotime("next Monday") . "<br>"); echo(strtotime("last Sunday")); ?>

          推薦:《PHP教程》

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號