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

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

【時間関数のテスト】
time = 1783496025
gmtime(time) = Wed Jul 8 07:33:45 2026
gmtime() = Wed Jul 8 07:33:45 2026
gmtime = Wed Jul 8 07:33:45 2026
localtime(time) = Wed Jul 8 16:33:45 2026
localtime() = Wed Jul 8 16:33:45 2026
localtime = Wed Jul 8 16:33:45 2026
(localtime)[$i] = 45 33 16 8 6 126 3 188 0
$year $mon $mday $hour $min $sec = 126 6 8 16 33 45
$fmt0 = "%04d/%02d/%02d %02d:%02d:%02d"
sprintf($fmt0, $year+1900,$mon+1,$mday,$hour,$min,$sec) = 2026/07/08 16:33:45
substr(localtime, 0, 3) = Wed

page update:

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