首頁  >  文章  >  後端開發  >  PHP日期函數範例學習筆記

PHP日期函數範例學習筆記

WBOY
WBOY原創
2016-08-08 09:27:03881瀏覽
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        // put your code here UNIX时间戳和获取当前的时间
        $time = strtotime("2011-11-11 11:11:11");
        $last = $time + (30*24*60*60);
        echo date("Y-m-d H:i:s", $last);
        echo "<br/>";
        echo print_r(getdate());
        echo "<br/>";
        echo date("Y-m-d H:i:s");
        echo "<br/>";
        date_default_timezone_set("ETC/GMT-8");
        echo date("Y-m-d H:i:s");
        ?>
    </body>
</html>

以上就介紹了PHP日期函數範例學習筆記,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn