On 21 August 2003 08:11, Cody Phanekham wrote: > > -----Original Message----- > > From: Curt Zirzow [mailto:[EMAIL PROTECTED] > > Sent: Thursday, 21 August 2003 17:11 > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] unexpected date results > > > > > > * Thus wrote Cody Phanekham ([EMAIL PROTECTED]): > > > <? > > > $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 > > Curt, > > The admin that is in charge of the server swears that the > time zone is already set to Australia / Sydney
Try using date from the command line and see what it produces. If you do something like: date '+%c' # might be different -- check your man date and it produces the wrong time, then you would be armed with sufficent evidence to go to the system's admin and say "oh no it **** well isn't -- look!" Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php