Leser: 2
|< 1 2 3 >| | 23 Einträge, 3 Seiten |
1 2 3 4
sub get_date{ my ($day,$month,$year) = (localtime time)[3..5]; return sprintf "%02d.%02d.%04d", $day, $month+1, $year+1900; }
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl use strict; use warnings; print get_date( '1183020463593' ); sub get_date{ my ($time) = @_; my ($sec,$min,$hour,$day,$month,$year) = (localtime $time)[0..5]; return sprintf "%02d.%02d.%04d %02d:%02d:%02d", $day, $month+1, $year+1900, $hour, $min,$sec; }
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
use strict;
use warnings;
my $time = 1183021696;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime( $time );
$mon += 1;
$year += 1900;
printf "%s.%s.%s %s.%s.%s\n", $mday, $mon, $year, $hour, $min, $sec;
print scalar localtime($time), "\n";
1
2
sidburn@sid:~/perl$ perl -wle 'print scalar localtime(1183020463593)'
Thu Jan 1 00:59:59 1970
1
2
sidburn@sid:~/perl$ perl -wle 'print scalar localtime(1185606012)'
Sat Jul 28 09:00:12 2007
1
2
sidburn@sid:~/perl$ perl -wle 'print scalar localtime(1185606012)'
Sat Jul 28 09:00:12 2007
|< 1 2 3 >| | 23 Einträge, 3 Seiten |