my 'modified' and 'created' fields in the database are being saved as
at GMT... and displayed as GMT. It seems to be a cake issue as manual
test shows - the time when the php test below was run was indeed
"14/02/2007 18:25:37" but if I had modified data in my model it would
update modified to be "14/02/2007 07:25:37"

Time zone on the server is set to local zone (Australia/Sydney) - whis
is GMT+11 at the moment.

-------------------------------------

[EMAIL PROTECTED] [~]# ls -l /etc/localtime
lrwxrwxrwx  1 root root 36 Feb 14 17:35 /etc/localtime -> /usr/share/
zoneinfo/Australia/Sydney

[EMAIL PROTECTED] [~]# clock
Wed 14 Feb 2007 06:20:58 PM EST  -0.150983 seconds
[EMAIL PROTECTED] [~]# hwclock
Wed 14 Feb 2007 06:21:01 PM EST  -0.251949 seconds

-------------------------------------

MySQL reports timezone as:
time zone  SYSTEM

-- result of query:
select now();
2007-02-14 18:21:36

-------------------------------------

Some PHP testing:

<?php
print("server timezone is: " . getenv('TZ') . "<br>\n");
print("server time is: " . date("d/m/Y H:i:s") . "<br><br>\n");
print("changing server time zone to Australia/Sydney....<br><br>\n");
putenv("TZ=Australia/Sydney");
print("new server time is: " . date("d/m/Y H:i:s") . "<br>\n");
print("new server timezone for this script is: " . getenv('TZ'));
print("changing server time zone to England/London....<br><br>\n");
putenv("TZ=England/London");
print("new server time is: " . date("d/m/Y H:i:s") . "<br>\n");
print("new server timezone for this script is: " . getenv('TZ'));

/** output is:
server timezone is:
server time is: 14/02/2007 18:25:37

changing server time zone to Australia/Sydney....

new server time is: 14/02/2007 18:25:37
new server timezone for this script is: Australia/Sydneychanging
server time zone to England/London....

new server time is: 14/02/2007 07:25:37
new server timezone for this script is: England/London
**/
?>

-------------------------------------

I ran the PHP test above within my cake app so I know it is not a
PHP / apache type setup to do with the virtualhost.

I am seeing the same problem on two Centos 4.3 servers - not had a
chance to test elsewhere...

Is there something I am missing as to why cake is storing and showing
me the modified / created dates in GMT rather than the time zone that
the php / mysql and the server believe we're in? Any ideas would be
much appreciated...

Thanks,

Dan.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to