RE: [PHP] getdate
| From: | Brian V Bonini | Date: | Wed, 10 Jul 2002 22:45:07 +0000 |
| Subject: | RE: [PHP] getdate | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106970@lists.php.net to get a copy of this message | ||
Hmmm, wierd!! The server is physically in PDT I am in EDT but I have the
servers time zone set to EDT and as I said "date" verifies the correct time
but yet the script returns a time that is 4 hours ahead. Wierd.... :(
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus@php.net]
> Sent: Wednesday, July 10, 2002 6:24 PM
> To: Brian V Bonini
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] getdate
>
>
> Works fine here. Are you actually in EDT?
>
> On Wed, 10 Jul 2002, Brian V Bonini wrote:
>
> > Any idea why this is off by 4 hours?
> >
> > Server time zone is set correctly,
> > %date
> > Wed Jul 10 14:26:18 EDT 2002
> > but the script below returns the time as being 4 hours later then that.
> >
> >
> > <?
> > $date = getdate();
> > $minutes = $date['minutes'];
> > $hours = $date['hours'];
> > $tz="EDT";
> > $today = getdate();
> > $month = $today['month'];
> > $mday = $today['mday'];
> > $year = $today['year'];
> > $ampm="AM";
> > if ($hours > 12) {
> > $hours=$hours-12;
> > $ampm="PM";
> > } elseif ($hours == 12) {
> > $ampm="PM";
> > }
> > if ( $minutes < 10) {
> > $minutes="0$minutes";
> > }
> > print "$hours:$minutes $ampm $tz $month $mday, $year";
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>