[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] Date problem with calendar
From: |
Stephan Cremer |
Subject: |
Re: [Phpgroupware-developers] Date problem with calendar |
Date: |
21 Aug 2002 08:30:26 +0200 |
/* $Id: class.datetime.inc.php,v 1.5.2.7 2002/08/12 22:50:30 skeeter Exp
$ */
in function datetime, the member variable $this->users_localtime is
calculated as the difference between $this->gmtnow and $this->tz_offset
* if $GLOBALS['phpgw_info']['server']['tz_offset'] is set,
$this->gmtnow is set to result of time() minus the this offset
* if the offset is not set, function $this->gmtnow is set to the result
of $this->getbestguess()
Now function $this->getbestguess returns the difference between
$this->convert_rfc_to_epoch(gmdate('D, d M Y H:i:s',$server_time).'
GMT') and time()
The result - at least in my case - is equal to the offset between GMT
and the time zone where I am located at.
=> Whereas function datetime will set users_localtime correct if a time
server is specified, this variable will be set to the timezone offset if
not - i.e. getbestguess() is called...
Best Regards,
Stephan.
> Hi,
>
> I have a strange problem with the calendar date on one of my
> installations. It always insists that we have January 1st, 1970. Once I
> change the view inside the calendar app everything is fine again, but
> leaving calendar and going back in brings me back to 1970.
>
> To make matters more confusing, this installation is a copy from another
> server, where everything runs fine. And yes, I copied the whole
> phpgroupware tree and the whole database. Of course there has to be a
> difference somewhere.
>
> I digged into the sources and found the reason I think.
> $GLOBALS['phpgw_info']['server']['tz_offset'] is set to a very high
> value almost 300000. Once I set this to zero (or whatever reasonable
> value) it works nicely. To dig any further I need to know where
> $GLOBALS['phpgw_info']['server']['tz_offset'] gets its info from, but I
> couldn't find that. I traced through datetime::datetime but it appears
> the first time this function is called
> $GLOBALS['phpgw_info']['server']['tz_offset'] is already set.
>
> Anyone out there with an idea what's going wrong?
>
> Thanks a lot.
>
> Michael
>
> --
> Michael Meskes
> address@hidden
> Go SF 49ers! Go Rhein Fire!
> Use Debian GNU/Linux! Use PostgreSQL!
>
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
>