|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-19 08:43 UTC] rasmus@php.net
[2001-11-19 08:50 UTC] hholzgra@php.net
[2001-11-19 08:56 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
/* Output from my attached PHP script: -output starts here- Server script path: /httpd/kunden/admbping/de/bigping/www/localtime_y2k.php original 'localtime()' function: tm_sec => 41 tm_min => 14 tm_hour => 14 tm_mday => 19 tm_mon => 10 tm_year => 101 tm_wday => 1 tm_yday => 322 tm_isdst => 0 my 'localtime_y2k()' function: tm_sec => 41 tm_min => 14 tm_hour => 14 tm_mday => 19 tm_mon => 11 tm_year => 2001 tm_wday => 1 tm_yday => 322 tm_isdst => 0 -output ends here- 'date' command in bash: localhost:/httpd/kunden/admbping/de/bigping/www # date Mon Nov 19 14:14:57 CET 2001 */ <? function localtime_y2k ($time, $is_ass) { $t_arr = localtime ($time, $is_ass); if ($is_ass == 0) { $t_arr[5] = $t_arr[5] + 1900; $t_arr[4] = $t_arr[4] + 1; } if ($is_ass == 1) { $t_arr["tm_year"] = $t_arr["tm_year"] + 1900; $t_arr["tm_mon"] = $t_arr["tm_mon"] + 1; } return $t_arr; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html lang=en_us> <head> <meta http-equiv=content-type content="text/html; charset=iso-8859-1"> <title> Untitled </title> </head> <body bgcolor="#FFFFFF"> <? $the_time = time(); $timearray_old = localtime ($the_time, 1); $timearray = localtime_y2k ($the_time, 1); echo "Server script path: ".getenv ("SCRIPT_FILENAME"); echo "<br><br><br>original 'localtime()' function:<br><br>"; while (list ($key, $val) = each ($timearray_old)) { echo "$key => $val<br>"; } echo "<br><br><br>my 'localtime()' function:<br><br>"; while (list ($key, $val) = each ($timearray)) { echo "$key => $val<br>"; } ?> </body> </html>