RE: [PHP] unexpected date results
| From: | Cody Phanekham | Date: | Thu, 21 Aug 2003 07:11:26 +0000 |
| Subject: | RE: [PHP] unexpected date results | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-160279@lists.php.net to get a copy of this message | ||
Curt,
The admin that is in charge of the server swears that the time zone is already set to Australia /
Sydney
> -----Original Message-----
> From: Curt Zirzow [mailto:curt@zirzow.dyndns.org]
> Sent: Thursday, 21 August 2003 17:11
> To: php-general@lists.php.net
> Subject: Re: [PHP] unexpected date results
>
>
> * Thus wrote Cody Phanekham (Cody.Phanekham@salmat.com.au):
> > <?
> > $t = time();
> > echo "\n<br>timestamp = $t";
> > echo "\n<br>time = " . date("r", $t);
> > ?>
> >
> > if i run test.php via the web it produces the following
> output, which is correct:
> > timestamp = 1061443716
> > time = Thu, 21 Aug 2003 15:28:36 +1000
> >
> > if i run test.php via the command line it produces the
> following output, which is off by 10 hours:
> > <br>timestamp = 1061443722
> > <br>time = Thu, 21 Aug 2003 05:28:42 +0000
>
> You need to set the timezone either system wide or within the
> crontab, since crontab usually runs with a /bin/sh shell something
> like:
>
> TZ=Australia/Melborne
> export TZ
>
> You'll have to consult your system documentation to set it system
> wide and to get the proper name of the TZ.
>
> That should help ya.
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
*************************************************************************************
This e-mail, including any attachments to it, may contain confidential and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or
take any action
based on the information contained within it.
Please notify the sender immediately by return e-mail of the error and then delete the original
e-mail.
The information contained within this e-mail may be solely the opinion of the sender and may not
necessarily
reflect the position, beliefs or opinions of Salmat on any issue.
This email has been swept for the presence of computer viruses known to Salmat's anti-virus
systems.
For more information, visit our website at www.salmat.com.au.
*************************************************************************************