Re: Dates ahead of time on PHP

From: Date: Sun, 07 May 2023 10:21:15 +0000
Subject: Re: Dates ahead of time on PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-328196@lists.php.net to get a copy of this message
> Date: Saturday, May 06, 2023 23:44:12 -0400 > From: paulf@quillandmouse.com > ... > $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 > Use a PHP function that returns the timezone that PHP is seeing, that will help you know what you're looking for. The "getdate" function doesn't include that bit, so you can't tell. It appears to be set to GMT/UTC.

« previous php.general (#328196) next »