> Rails doesn't quite do this. It simply has no timezone
> support whatsoever for Date objects and Date fields in
> the database. If you enter "2008-09-09" into a field on
> the site, it will get parsed into a > Date representing
> September 9th, 2008. When saved to the database, it will
> be 2008-09-09 regardless of any timezones set for Rails
> or the user. When it is pulled out of the database, it
> will still be "2008-09-09" regardless of timezones.
Ok, so what you are saying is that Show From and Due are not
sensitive to timezone settings because they are typed Date.
Since we do no manual timezone conversion, this means that we
do not store Dates 'in UTC' in the database, only DateTimes
are stored 'as UTC' in the database
> > My last remaining question is rails related. How does rails handle the
> > following query
> > find(:all, :conditions => ['show_from <= ?', Time.now.utc ]).collect {
|t|
> > t.activate! }
> > I know that Todo.show_from is mapped to the correct timezone, but I
could
> > not find / google if the show_from in the :conditions is mapped to the
> > correct timezone.
> It does, in fact, just drop that value into the SQL query. But
> let's say I'm in UTC-8 and I want to show todo X on 2008-09-09.
> If I hit the Tickler at, say, 10PM Eastern on the 9th, Time.now.utc
> will be 2008-09-10, so any events with a show_from of 2008-09-10 will
> leave the Tickler, even though it isn't tomorrow yet in my local
> timezone. Thus we need to compare against the current date in the
> user's local timezone.
I agree that since we do not store 'as UTC' we need to compare to the
user's local timezone. I'll apply your patch.
Considering the email from Mathew, we could consider migrating from Date
to DateTime so we keep storing dates in UTC in the database for consistency.
This will solve problems for people moving from timezone to another. I
don't know if this is worth the trouble though...
Reinier
_______________________________________________
Tracks-discuss mailing list
[email protected]
http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss