On Fri, May 30, 2003 at 01:11:41PM -0500, Paul DuBois wrote:
> At 19:24 +0200 5/30/03, Michael Neumann wrote:
> >On Fri, May 30, 2003 at 07:21:19AM -0500, Paul DuBois wrote:
> >> At 12:13 +0200 5/30/03, Michael Neumann wrote:
> >> >Hi,
> >> >
> >> >What do you think?
> >> >For me it seems natural to use the local timezone instead of GMT.
> >>
> >> Stefano's right that datetime values in MySQL have no timezone
> >> information.
> >>
> >> But the time returned is in the *server's* local timezone.
> >
> >So, if we don't know the server's timezone, the best we could do is to
> >assume GMT (this at least would be determinant). Of course this
> >behaviour should be documented somewhere.
> >
> >Would you agree?
>
> I agree, but I wasn't clear on why there was any problem with using
> Time.gm in the first place. How does that manifest itself as incorrect
> behavior?
Well, if you store a datetime value in the database which is not in GMT
(the value), then retrieve the same value from the database, it will be
a different one (unless you always store datetime values in GMT).
But without knowing the timezone, I fear there's no way to prevent that.
Regards,
Michael
|