6 Einträge, 1 Seite |
1
2
1113193722 user 127.0.0.1 1113193718 55555
1113193722 keins 127.0.0.1 1113193718 66666
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
===========================
time:Mo Apr 20 12:50:33 2005
ip: 127.0.0.1
password: test
<body>
irgasdklgj
asvlkasjdv
slakdfj
============================
time: Tue Apr 21 11:50:33 2005
ip: 127.0.0.1
password: password2
asvklhaskdjvhasdv
sdvasdvasdvsdv
============================
time: Tue Apr 21 11:50:33 2005
ip: 127.0.0.1
password: password2
asvklhaskdjvhasdv
sdvasdvasdvsdv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sub date
{
my ($date) = @_;
my ($y, $m, $d);
($y,$m,$d) = ($date =~ /^(\d{4})(\d{2})(\d{2})$/)
or
($y,$m,$d) = ($date =~ /^(\d{4})-(\d{1,2})-(\d{1,2})$/)
or
($d,$m,$y) = ($date =~ /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/)
or
($m,$d,$y) = ($date =~ m#^(\d{1,2})/(\d{1,2})/(\d{4})$#)
or
fehler "falsches Format";
return timegm(0,0,0, $d,$m-1,$y-1900);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/perl
use strict;
use warnings;
use Time::Local;
my $string = 'time: Tue Apr 21 11:50:33 2005';
my $timestamp = get_time($string);
print $timestamp,"\n";
sub get_time{
my ($string) = @_;
my %months = (Jan => 0, Feb => 1, Mar => 2, Apr => 3,
May => 4, Jun => 5, Jul => 6, Aug => 7,
Sep => 8, Oct => 9, Nov => 10,Dec => 11,);
my (undef,undef,undef,$mon,$day,$hr,$min,$sec,$year) = split(/[:\s]/,$string);
my $time = timelocal($sec,$min,$hr,$day,$months{$mon},$year-1900);
return $time;
}
1
2
3
my $timestamp = '1114077033';
my $readable = localtime($timestamp);
print $readable,"\n";
6 Einträge, 1 Seite |