[Dbix-class] DateTime Inflation

Drew Taylor drew at drewtaylor.com
Thu Oct 18 00:39:24 GMT 2012


TIL that you can specify the timezone in the definition for a datetype
column! How did I overlook this for all this time?! This is such a
good thing. Unfortunately, now I have to make sure it doesn't
interfere with all the workarounds I've put in place to deal with lack
of UTC timezone. Thanks for the tip!

Sadly, I don't have an answer to your question but I would find it
very, very useful as well. Perhaps the DateTime inflator would be a
good place to look and/or patch?

Drew

On Thu, Oct 18, 2012 at 12:34 AM, neil.lunn <neil at mylunn.id.au> wrote:
> I have a legacy database that has Date type data in the local timezone
> rather than UTC. As such I have these statements in my class definitions:
>
>   "creation_date",
>   {
>     data_type => "DATE",
>     timezone => 'America/Montreal',
>     locale => 'en_US',
>     default_value => undef,
>     is_nullable => 1,
>     size => 19,
>   },
> While this works for DateTime inflation, it would be nicer :) to not have
> the timezone information declared in each column. Or more practically, I
> don't like this being hardcoded and would rather pick up from the current
> timezone or config.
>
> Anyone have any better approaches? Ideas?
>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk



More information about the DBIx-Class mailing list