Thread Deutsche Sommer u. Winterzeit in UTC umrechnen (39 answers)
Opened by Speedriff at 2013-11-27 14:51

GwenDragon
 2013-11-28 13:36
#172275 #172275
User since
2005-01-17
14761 Artikel
Admin1
[Homepage]
user image
Öhm. Hab ich das so gepostet? In msg #172268!
2013-11-28T09:26:13 GwenDragon
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use DateTime;

use IO::All;
$temp < io($file);  

sub conv_dt {
        my ($Day,$Month,$Year,$Hour,$Minute) = @_;
        my $dt = DateTime->new(
                year      => $Year,
                month     => $Month,
                day       => $Day,
                hour      => $Hour,
                minute    => $Minute,
                second    => 0,
                time_zone => 'Europe/Berlin',
        );
        $dt->set_time_zone('UTC');
        return $dt->strftime('%d.%m.%Y %H:%M');
}

# ersetze alle Matches durch das Ergebnis von conv_dt in einem Multiline-zeichenkette
$temp =~ s/^(\d\d)\.(\d\d)\.(\d\d\d\d)\s(\d\d):(\d\d)/conv_dt($1,$2,$3,$4,$5)/egm;

$temp > io($file); 



Zeile 70-74 stimmt bei dir nicht!

View full thread Deutsche Sommer u. Winterzeit in UTC umrechnen