logging: Check if typescripts with a similar name already exist
[sunny256-utils.git] / date2iso
blob061586f60951a7c5c79e059c70ed282410403fe2
1 #!/usr/bin/env perl
3 # date2iso
4 # File ID: 35e0af3c-5d38-11df-8eb4-90e6ba3022ac
5 # Konverterer obskure dataformater til ISO-8601.
7 use strict;
8 use warnings;
10 my %mnd_str = (
11 'Jan' => '01',
12 'Feb' => '02',
13 'Mar' => '03',
14 'Apr' => '04',
15 'May' => '05',
16 'Jun' => '06',
17 'Jul' => '07',
18 'Aug' => '08',
19 'Sep' => '09',
20 'Oct' => '10',
21 'Nov' => '11',
22 'Dec' => '12'
25 while (<>) {
27 (Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s+
28 (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
29 (\d+)\s+
30 (\d\d:\d\d:\d\d)\s+
31 ([A-Za-c]+\s+)?
32 (\d\d\d\d)
34 sprintf("%s %04u-%s-%02u %s%s",
35 $1,
36 $6,
37 $mnd_str{$2},
38 $3,
39 $4,
40 defined($5)
41 ? " $5"
42 : "",
44 /eix;
46 (Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s+
47 (\d+)\s+
48 (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
49 (\d\d\d\d)\s+
50 (\d\d:\d\d:\d\d)
52 sprintf("%s %04u-%s-%02u %s", $1, $4, $mnd_str{$3}, $2, $5)
53 /eix;
54 print;
57 # vim: set noet :