Veritas-bu

[Veritas-bu] Convert ctime to english...

2004-01-19 11:35:21
Subject: [Veritas-bu] Convert ctime to english...
From: rlh AT lsil DOT com (Richard Hellier)
Date: Mon, 19 Jan 2004 16:35:21 -0000
This is a multi-part message in MIME format.

------=_NextPart_000_063F_01C3DEAA.3B3017C0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hampus,
    Try this perl script:

Cheers,

Richard.

-----------------

#!/usr/bin/perl -w

use Time::Local;
use strict;

my %monthTab =3D (
        Jan     =3D>      0,
        Feb     =3D>      1,
        Mar     =3D>      2,
        Apr     =3D>      3,
        May     =3D>      4,
        Jun     =3D>      5,
        Jul     =3D>      6,
        Aug     =3D>      7,
        Sep     =3D>      8,
        Oct     =3D>      9,
        Nov     =3D>      10,
        Dec     =3D>      11,
);

my ($dow, $month, $dom, $hms, $year) =3D @ARGV;

die "Not enough arguments" unless ($year);

my ($h, $m, $s) =3D split(/:/, $hms);

print timelocal($s, $m, $h, $dom, $monthTab{$month}, $year);


------=_NextPart_000_063F_01C3DEAA.3B3017C0
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hampus,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Try this perl=20
script:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Richard.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-----------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#!/usr/bin/perl -w</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>use Time::Local;<BR>use =
strict;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>my %monthTab =3D=20
(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Jan&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Feb&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
1,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Mar&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
2,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Apr&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
3,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
May&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
4,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Jun&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
5,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Jul&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
6,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Aug&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
7,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Sep&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
8,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Oct&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
9,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Nov&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
10,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Dec&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11,<BR>);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>my ($dow, $month, $dom, $hms, $year) =
=3D=20
@ARGV;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>die "Not enough arguments" unless=20
($year);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>my ($h, $m, $s) =3D split(/:/, =
$hms);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>print timelocal($s, $m, $h, $dom,=20
$monthTab{$month}, $year);<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_063F_01C3DEAA.3B3017C0--