Re: Dates ahead of time on PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> Date: Saturday, May 06, 2023 23:44:12 -0400
> From: paulf@xxxxxxxxxxxxxxxxx
> 
  ...

> $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.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux