Problem: Date shows May 31, 2004 even though my server shows June 1, 2004. Problem is in the mini monthly block calendar (dont know if the weekly, etc blocks are affected as i don't use that).
To test go in ./blocks/pical_mini_calendar.php ~55
echo $cal->month; // displays 6
include( "$mod_path/read_configs.php" ) ;
echo $cal->month; // changes to 5
after some lengthy debugging (before finding the above), i came to the conclusion that the problem is in read_configs.php line ~35. I'm not sure if this is intentional or something you were doing when testing. Anyways, the fix is
./read_configs.php
FROM
$cal->user_TZ = $xoopsUser->timezone() ;
$cal->server_TZ = date( 'Z' ) / 3600 ;
// $cal->server_TZ = $xoopsConfig['server_TZ'] ;
TO
$cal->user_TZ = $xoopsUser->timezone() ;
//$cal->server_TZ = date( 'Z' ) / 3600 ;
$cal->server_TZ = $xoopsConfig['server_TZ'] ;
[edit]
It could have been because of the daylight savings. once it hit 1am (0:00) here, it worked fine with the original code.
[/edit]
hi zer0fill.
Thank you for the suggestion.
The code of
$cal->server_TZ = date( 'Z' ) / 3600 ;
means there are many XOOPS which is set server_TZ
wrongly.
I didnot know this code is harmful.
I want to fix timezone/daylight problems, but it is not so soon.
When I'll try it, your suggestion must be useful for me.
p.s. Please tell me your server's time zone name.
echo $cal->user_TZ = $xoopsUser->timezone() ; // -8.0
echo $cal->server_TZ = $xoopsConfig['server_TZ'] ; // -5
echo $cal->server_TZ = date( 'Z' ) / 3600 ; // -4
Server = east coast (Canada)
User = west coast (California, USA)
maybe Xoops 2.0.6 already accounts for daylight savings? I have server timezone set to
(GMT-5:00) Easter Time (US & Canada), Bogota, Lima, Quito in XOOP's general settings.