10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl -w
use strict;
use warnings;
my $wann = "";
$wann = $ARGV[0] || <STDIN>;
my ($sek,$min,$hour,$mday) = localtime $wann;
printf("%02i:%02i:%02i:%02i\n", $mday, $hour, $min, $sek);
1
2
3
4
5
6
7
8
#!/usr/bin/perl -w
use strict;
use warnings;
my $wann = time;
my ($sek,$min,$hour,$mday) = localtime $wann;
printf("%02i:%02i:%02i:%02i\n", $mday, $hour, $min, $sek);
1
2
3
4
5
chomp(my $t=<>);
my $s = $t % 60; $t = int ($t/60);
my $m = $t % 60; $t = int ($t/60);
my $h = $t % 24; $t = int ($t/24);
print "$t Tage, $h Stunden, $m Minuten, $s Sekunden";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl -w
#
# Syntax: seconds2date [seconds]
#
if ($ARGV[0]) { $wann = $ARGV[0]; }
else { $wann = <STDIN>; }
#($sek,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime $wann;
($sek,$min,$hour,$mday,$mon,$year) = gmtime $wann;
$year-= "70";
$mday--;
if ( $hour < "10") { $hour = "0" . $hour; }
if ( $min < "10") { $min = "0" . $min; }
if ( $sek < "10") { $sek = "0" . $sek; }
print "$hour:$min:$sek - $mday Tage $mon Monate $year Jahre\n";
print "Hello Perl-Community\n";
my $datum = sprintf "%02s.%02s.%4s", $tag, $monat, $jahr;
10 Einträge, 1 Seite |