[Munich-pm] Summertime in Redmond

Jürgen Mück jurgen.muck at yahoo.de
Sun Mar 25 14:40:02 PDT 2012


Hallo Mongers, 
 
habt Ihr (am Sonntag :-) Erfahrung mit der Kombination Windows + Sommerzeit + stat() gemacht? 
 
Bei mir (Win XP SP3, Active Perl v5.12.4) springt im Explorer die Speicherzeit der Dateien um eine Stunde, wenn ich Sommerzeit aus- und einschalte. Ist noch lustig. 
 
Weniger lustig finde ich, dass in Perl die Abfrage der modification time in stat abhängig vom Sommerzeit-Flag ist, obwohl die Epoch zurueckgegeben wird (mein erster Post mit Code, Bitte um Nachsicht für mangelnde Professionalität): 
 
#c:/perl/bin/perl
>warn "Effect on Windows only?" unless $^O=~/WIN/i;
> 
>my $epoch = (stat $0)[9]; # modification time  
>print "Epoch of $0 is $epoch. \n";
> 
>print "Please toggle Summertime (e.g. by using the windows GUI)\n";
>(<>);
> 
>my $epoch_toggled = (stat $0)[9]; 
>print "Epoch of $0 is $epoch_toggled. \n";
> 
>die "You have to change the Summertime flag!" unless $epoch != $epoch_toggled; 
>printf "You changed the Summertime flag to >%s< (dt = %ds).\n", 
>       $epoch_toggled>$epoch ? "ON" : "OFF", $epoch_toggled - $epoch;
>
-> Als Datei speichern und aufrufen, verwendet das Speicherdatum der Datei. Leider stand mir der CMD-Befehl "TZ" nicht zur Verfügung, mit dem Zeitzonen im Script etc. geändert werden können, so dass man hier das Sommerzeit-Flag manuell ein/ausschalten muss. 
 
Bei mir sieht das so aus: 
D:\p\src\learning>perl 31_win_dst_stat.pl
>Epoch of 31_win_dst_stat.pl is 1332710328.
>Please toggle Summertime (e.g. by using the windows GUI)
>Epoch of 31_win_dst_stat.pl is 1332713928.
>You changed the Summertime flag to >ON< (dt = 3600s).
Ich bin bei einem Tool auf die Verwendung der Speicherzeit angewiesen und verwende mal Dateien, die während der Sommerzeit entstanden sind, mal Dateien ohne Sommerzeit. Der Effekt bricht mein Tool.  
 
Mache ich etwas falsch (außer dass ich MS Windows verwende)?
 
Grüße
Jürgen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/munich-pm/attachments/20120325/929de30e/attachment.html>


More information about the Munich-pm mailing list