This piece of code seems to work fine on my linux box, except for item: 391263207 => "Sonntag, 26.05.2013 - 13:13:27". Could you run it on more data?
Output:#!/usr/bin/perl use warnings; use strict; use Date::Calc qw(Day_of_Week Day_of_Week_to_Text); use Time::Local; my %date_pairs = ( 391263207 => "Sonntag, 26.05.2013 - 13:13:27", 410000659 => "Sonntag, 29.12.2013 - 10:04:19", 410891318 => "Mittwoch, 08.01.2014 - 17:28:38", 412528640 => "Montag, 27.01.2014 - 16:17:20", 413028709 => "Sonntag, 02.02.2014 - 11:11:49", 414241970 => "Sonntag, 16.02.2014 - 12:12:50", 433494560 => "Samstag, 27.09.2014 - 09:09:20" ); $ENV{TZ} = 'Europe/Berlin'; # sec,min,hours,day,month,year my $epoch = timegm(0, 0, 0, 1, 0, 70); my $macep = timegm(0, 0, 0, 1, 0, 101); print "$epoch -- $macep\n"; foreach my $key ( sort keys %date_pairs ) { # 0 1 2 3 4 5 6 7 8 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localti +me($key+$macep); $mon++; $year += 1900; my $dstr = Day_of_Week_to_Text(Day_of_Week($year, $mon, $mday), 3) +; my $datestr = sprintf("%-8s %02d.%02d.%02d %02d:%02d:%02d %d", $ds +tr, $mday, $mon, $year, $hour, $min, $sec, $isdst); print "$key - $date_pairs{$key} -- $datestr\n"; }
Regards0 -- 978307200 391263207 - Sonntag, 26.05.2013 - 13:13:27 -- Sonntag 26.05.2013 14: +13:27 1 410000659 - Sonntag, 29.12.2013 - 10:04:19 -- Sonntag 29.12.2013 10: +04:19 0 410891318 - Mittwoch, 08.01.2014 - 17:28:38 -- Mittwoch 08.01.2014 17: +28:38 0 412528640 - Montag, 27.01.2014 - 16:17:20 -- Montag 27.01.2014 16: +17:20 0 413028709 - Sonntag, 02.02.2014 - 11:11:49 -- Sonntag 02.02.2014 11: +11:49 0 414241970 - Sonntag, 16.02.2014 - 12:12:50 -- Sonntag 16.02.2014 12: +12:50 0 433494560 - Samstag, 27.09.2014 - 09:09:20 -- Samstag 27.09.2014 09: +09:20 1
In reply to Re: Date::Calc and and daylight savings time
by pme
in thread Date::Calc and and daylight savings time
by marek1703
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |