Content-Type:text/html 時間関数のテスト

※このサンプルの解説は、「CGIの扉」をすべて読み終えてる方を前提としています。

【時間関数のテスト】
time = 1733964358
gmtime(time) = Thu Dec 12 00:45:58 2024
gmtime() = Thu Dec 12 00:45:58 2024
gmtime = Thu Dec 12 00:45:58 2024
localtime(time) = Thu Dec 12 09:45:58 2024
localtime() = Thu Dec 12 09:45:58 2024
localtime = Thu Dec 12 09:45:58 2024
(localtime)[$i] = 58 45 9 12 11 124 4 346 0
$year $mon $mday $hour $min $sec = 124 11 12 9 45 58
$fmt0 = "%04d/%02d/%02d %02d:%02d:%02d"
sprintf($fmt0, $year+1900,$mon+1,$mday,$hour,$min,$sec) = 2024/12/12 09:45:58
substr(localtime, 0, 3) = Thu

page update:

Copyright (c) 2000-2009, all Rights Reserved & Produced by atom