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

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

【時間関数のテスト】
time = 1737187001
gmtime(time) = Sat Jan 18 07:56:41 2025
gmtime() = Sat Jan 18 07:56:41 2025
gmtime = Sat Jan 18 07:56:41 2025
localtime(time) = Sat Jan 18 16:56:41 2025
localtime() = Sat Jan 18 16:56:41 2025
localtime = Sat Jan 18 16:56:41 2025
(localtime)[$i] = 41 56 16 18 0 125 6 17 0
$year $mon $mday $hour $min $sec = 125 0 18 16 56 41
$fmt0 = "%04d/%02d/%02d %02d:%02d:%02d"
sprintf($fmt0, $year+1900,$mon+1,$mday,$hour,$min,$sec) = 2025/01/18 16:56:41
substr(localtime, 0, 3) = Sat

page update:

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