in reply to How to use the right timezone in a DBIx::Class ResultSet call?
Untested; DBIx::Class::Manual::Intro. Couple other ways to do it. I would suggest that you probably really want it done in your ResultSet classes such that the TZ can be included with SQL functions at the point of running the query for individual users or locations; the best way would be to have the TZ available in a relationship otherwise you might have to resort to non-standard argument handling in the queries. This approach, obviously, sets it for all queries.
my $schema = YOUR::Schema->connect ("dbi:YourDBD:$DB_NAME", undef, undef, # credentials should never be hardcoded. { AutoCommit => 1, RaiseError => 1 }, { on_connect_do => "SET TIMEZONE='Australia/Sydney'" } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use the right timezone in a DBIx::Class ResultSet call?
by LittleJack (Beadle) on Aug 11, 2022 at 22:45 UTC | |
by Your Mother (Archbishop) on Aug 12, 2022 at 01:14 UTC |