Read A.J. comment, to which I replied.

There is nothing more to say as it's correct.
And read the manual... timezone handling is described.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Alex" <outroa...@gmail.com>
To: <fw-general@lists.zend.com>
Sent: Thursday, March 12, 2009 6:55 PM
Subject: Re: [fw-general] Re: Handling timezones?


Hi Thomas,

Right, I understand UTC dates are UTC.

My question is how to convert to the user's timezone application wide. How does Zend Date know the date I'm giving it for creation is UTC and that the
date I want output is in the user's timezone?

- Alex



On Thu, Mar 12, 2009 at 2:49 PM, Thomas Weidner <thomas.weid...@gmx.at>wrote:

You can't display UTC dates with local time.

UTC is per definition without any timezone.
Local dates/times are per definition with a timezone.

This is why the time does also change when you set another timezone.
f.e. 10:00 UTC == 12:00 GMT+2

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "A.J. Brown" <fynw...@gmail.com>
To: "Alex" <outroa...@gmail.com>
Cc: <fw-general@lists.zend.com>
Sent: Thursday, March 12, 2009 6:37 PM
Subject: Re: [fw-general] Re: Handling timezones?



First, you'll want to make sure MySQL and your applications are using the
same timezone.  MySQL doesn't store the timezone, so it doesn't care in
regards to dates being passed in, but you'll run into consitency problems
if
you use MySQL date functions in combination.

The documentation is unclear on how to display UTC dates as locale times
(within proper timezone), but it does state that Zend_Date works
independently of the internal php timezone. I would try reading the date
from the database into a Zend_Date object, then setting the timezone to
the
user's timezone before returning the date.

Let us know how that works out.


On Thu, Mar 12, 2009 at 10:12 AM, Alex <outroa...@gmail.com> wrote:

 Anyone?

- Alex



On Wed, Mar 11, 2009 at 12:50 PM, Alex <outroa...@gmail.com> wrote:

 Hello,

What's the recommended strategy for handling timezones with Zend_Date?
I
use the datetime in mysql to store dates.

What's the right combination of date_default_timezone_set and Zend_date
so
that everything is always stored in UTC and the user always sees dates
in
his local time?

- Alex






--
A.J. Brown
web | http://ajbrown.org
phone | (937) 660-3969






Reply via email to