Dates ahead of time on PHP

From: Date: Sun, 07 May 2023 03:44:12 +0000
Subject: Dates ahead of time on PHP
Groups: php.general 
Request: Send a blank email to php-general+get-328192@lists.php.net to get a copy of this message
I just upgraded my Debian OS, which updated me to PHP 8.2. Now, when I issue the following: $now = getdate(time()); echo '<pre>'; print_r($now); echo '</pre>'; Here's what I get: Array ( [seconds] => 47 [minutes] => 34 [hours] => 3 [mday] => 7 [wday] => 0 [mon] => 5 [year] => 2023 [yday] => 126 [weekday] => Sunday [month] => May [0] => 1683430487 ) I'm doing this on 6 May 2023 at about 23:39. Note that the date returned is on the *following* date, one day ahead of today. Here's what my system returns: $ date Sat May 6 11:39:41 PM EDT 2023 This verifies that my system date is Saturday 6 May 2023. And yet PHP's date routines are returning 7 May 2023. So my question is, where is getdate(time()) getting its date information? And why isn't it using my system's date? Paul -- Paul M. Foster Personal Blog: http://noferblatz.com Company Site: http://quillandmouse.com Software Projects: https://gitlab.com/paulmfoster

« previous php.general (#328192) next »