函數strtotime

語法:strtotime(時間字串[,時間戳記])

功能:將有時間意義的英文字串轉換為時間戳記。若加上時間戳記參數,則代表要以這個時間戳記為基準來換算日期。使用範例如下:

echo strtotime(“now”), “\n”;
echo strtotime(“10 September 2000”), “\n”;
echo strtotime(“+1 day”), “\n”;
echo strtotime(“+1 week”), “\n”;
echo strtotime(“+1 week 2 days 4 hours 2 seconds”), “\n”;
echo strtotime(“next Thursday”), “\n”;
echo strtotime(“last Monday”), “\n”;
echo strtotime(“tomorow”), “\n”;
echo strtotime(“yesterday”), “\n”;

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Proudly using Dynamic Headers by Nicasio WordPress Design