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

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

【時間関数のテスト】
time = 1760576946
gmtime(time) = Thu Oct 16 01:09:06 2025
gmtime() = Thu Oct 16 01:09:06 2025
gmtime = Thu Oct 16 01:09:06 2025
localtime(time) = Thu Oct 16 10:09:06 2025
localtime() = Thu Oct 16 10:09:06 2025
localtime = Thu Oct 16 10:09:06 2025
(localtime)[$i] = 6 9 10 16 9 125 4 288 0
$year $mon $mday $hour $min $sec = 125 9 16 10 9 6
$fmt0 = "%04d/%02d/%02d %02d:%02d:%02d"
sprintf($fmt0, $year+1900,$mon+1,$mday,$hour,$min,$sec) = 2025/10/16 10:09:06
substr(localtime, 0, 3) = Thu

page update:

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