Hello,

Today we got some issues calculating the future dates.

Code:

#!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use DateTime;
> use DateTime::TimeZone;
>
> my $z = 1285545745;
>
> my $tz = DateTime::TimeZone->new(name => 'Europe/Helsinki');
>
> my $dt = DateTime->from_epoch(epoch => $z, time_zone => $tz);
> my $date = sprintf "%02d.%02d.%04d %02d:%02d:%02d", $dt->day, $dt->month,
> $dt->year, $dt->hour, $dt->minute, $dt->second;
> print "$date\n";
>
> $dt->add(months => 6);
> my $expdate = sprintf "%02d.%02d.%04d", $dt->day, $dt->month, $dt->year;
>
> print "$expdate\n";
>

Result:

27.09.2010 03:02:25
> Invalid local time for date in time zone: Europe/Helsinki
>

I hope it will be resolved :)

Thanks,
Alek

Reply via email to