On 7/12/06 6:11 PM, Cory R. King wrote:
> Is there any kind of "best practice" for date localization?  Who handles
> what?  Should each template be responsible for handling all this?  Can
> something lower level, like Rose::DB, or a Rose::DB::Object handle this
> once per session?

RDBO's bundled timestamp and date/time column types do have the ability to
convert DateTime objects to a canonical time zone before storing them in
database.  From the docs:

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/MakeMethods/Da
te.pm#timestamp

"The time zone of the DateTime object that results from a successful parse
is set to the value of the time_zone option, if defined. Otherwise, it is
set to the server_time_zone value of the object's db attribute using
DateTime's set_time_zone method."

But this is really only useful if your input forms (or whatever) produce
DateTime objects with explicit (i.e., non-floating) time zones, otherwise
the "conversion" won't do anything.

In the absence of any explicit action (e.g., a setting a server_time_zone()
on your db objects) DateTime objects will "pass through" RDBO as-is.  That
simplifies things significantly.  IME, it's best to store all dates in the
db in a single time zone and then convert to the user's time zone when
displaying the dates.

-John




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to