[Catalyst] Catalyst::Plugin::DateTime
Jason Kohles
email at jasonkohles.com
Mon Mar 12 13:40:21 GMT 2007
On Mar 10, 2007, at 12:14 AM, Bill Moseley wrote:
> On Sat, Mar 10, 2007 at 06:33:22AM +0200, Octavian Rasnita wrote:
>> Hi,
>>
>> I have tried to install Catalyst::Plugin::DateTime under Windows
>> using the
>> cpan shell, but I have recieved the error below.
>> I have also previously set the environment variable TZ=+02:00 but
>> it still
>> can't find the time zone.
>> Is there anything I can do to install this Catalyst Plugin under
>> Windows?
>
> What does that plugin offer over the standard DateTime module?
>
Nothing except the ability to say $c->datetime or $c->dt. In fact,
this is the entirety of the code of the module....
sub datetime {
my $c = shift;
my %params = @_;
my $tz = delete $params{time_zone} || 'local';
# use params if argued
if (%params) {
return DateTime->new(\%params)->set_time_zone($tz);
}
else { # otherwise use now
return DateTime->now(time_zone => $tz);
}
}
# alias $c->dt
*dt = \&datetime;
--
Jason Kohles
email at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070312/b28f08ea/attachment.htm
More information about the Catalyst
mailing list