On Aug 6, 7:00 am, byrnejb <[email protected]> wrote:
> Three questions:
>
>   How is :local determined?  If by the host local time then this would
> have consistency implications for host transfers or multi-host
> support.  I realise that using UTC is indicated in these situations,
> but sometimes the utc approach is not available, particularly when
> dealing with so-called 'legacy' databases.

:local would be whatever the local timezone is according to ruby.

>   Is any provision contemplated for specifying arbitrary timezones;
> +500, -1100, EST, PST, GMT, CET, etc. in addition to :local and :utc?
> If this is done then to handle daylight savings nonsense one also
> would have to provide for named timezones a la AR (Eastern Time (US &
> Canada), Indiana (East).

It's not hard to specify arbitrary timezones for DateTimes, so I may
support that if Sequel.datetime_class == DateTime.  You can't do it
with ruby's standard Time class, because that is limited to UTC and
the system timezone.  That's the reason ActiveSupport adds the
TimeWithZone class (which I'm guessing AR uses).

Named timezones are pretty much out, at least by default.  I'll make
it flexible enough that you can handle it via an extension that uses
TZInfo.

>   Are the timestamp display options to implemented so as to provide
> methods readily available for framework or custom controllers, views,
> and helpers so that sessions may have displayed times automatically
> adjusted to the user's own timezone, if such data is kept in the
> application as part of their profile?

What I'm talking about is converting the object to a local/utc/other
timezone when storing to and retrieving from the database.  If you
don't want to use a single time zone, but convert it based on the
current user, you'll pretty much have to use a hack similar to the one
ActiveSupport uses, by storing the desired time zone in a thread local
variable, and then converting times to that (via an extension, since
that won't be supported by default).

>   I realise that Sequel is strictly an ORM, but once one starts
> detailing view specific items such as time then the uses made of this
> information needs some consideration.

Sequel shouldn't care at all about the view, it should only be
concerned with returning objects in a given time zone.  How the view
wants to display the objects shouldn't have an effect.

Thank you very much for the post, it's helped me realize that the most
important thing is for this support is to make it flexible enough so
that it is easily overridable with extensions (which I'll probably
ship with Sequel).

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to