Thread Datumsfunktion...: Boa, das is scheisse kompliziert.. (8 answers)
Opened by steinwolf at 2003-08-19 19:32

steffen
 2003-08-20 17:37
#72952 #72952
User since
2003-08-19
4 Artikel
BenutzerIn
[default_avatar]
so in der Art?:

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/perl

my &#36a = 0;
my &#36sethour = 0;
my &#36setmin = 0;
while (&#36a == 0)
{

        (&#36sec,&#36min,&#36hour,&#36mday,&#36mon,&#36year,&#36wday,&#36yday,&#36isdst) = localtime(time);
        &#36mon=&#36mon+1;
        &#36year=&#36year+1900;

    #system(clear);
    print "   Perl Alarm Clock\n";
    print "  -================-\n";
print "
Jetzt ist:

Jahr  = &#36year
Monat = &#36mon
Tag   = &#36mday

Stunde  = &#36hour
Minute  = &#36min

";

    print "Hour to play: ";
    &#36sethour = <STDIN>;
    chomp &#36sethour;

    print "Minute to play: ";
    &#36setmin = <STDIN>;
    chomp &#36setmin;

    while (&#36a == 0)
    {
    #    system();
        (&#36sec,&#36min,&#36hour,&#36mday,&#36mon,&#36year,&#36wday,&#36yday,&#36isdst) = localtime(time);
        &#36mon=&#36mon+1;
        &#36year=&#36year+1900;
        print "h= &#36hour m= &#36min s= &#36sec  D=&#36mday M=&#36mon Y=&#36year &#36wday &#36yday &#36isdst|\n";
        print "Wake up time: &#36sethour:&#36setmin:00\n";
        sleep (10);
        if (&#36hour == &#36sethour && &#36min == &#36setmin) #<-Hier kannst Du beliebig erweitern
        {
        print "beeb "; #oder welche Aktion auch immer
            &#36a++;
        }
    }
}


Steffen\n\n

<!--EDIT|Crian|1061397574-->

View full thread Datumsfunktion...: Boa, das is scheisse kompliziert..