Thread timelocal Wochentag? (4 answers)
Opened by Froschpopo at 2007-11-06 04:01

Froschpopo
 2007-11-06 04:01
#101903 #101903
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Hallo :)

Warum sind die Wochentage nicht identisch??? Ist doch derselbe Tag!

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

use strict;
use Time::Local;

my $date = "2007-11-06 02:15:04";
my @times = $date =~ /(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/;

my $time = timelocal(reverse @times);

my $wday1 = (localtime($time))[6];
my $wday2 = (localtime())[6];

print $wday1,"\n", $wday2,"\n";

View full thread timelocal Wochentag?