Veritas-bu

[Veritas-bu] Re: converting unix time

2001-03-09 11:35:31
Subject: [Veritas-bu] Re: converting unix time
From: anthony.guzzi AT storability DOT com anthony.guzzi AT storability DOT com
Date: Fri, 9 Mar 2001 11:35:31 -0500
This is a multipart message in MIME format.
--=_alternative 005AD98E85256A0A_=
Content-Type: text/plain; charset="us-ascii"

For those of us who are really lazy and dont want to get the modules, the 
following Perl code program produces the same output as the 'bpdbm -ctime' 
command:

#!/usr/local/bin/perl
($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($ARGV[0]);
printf "%d = %s %s %2d %2d:%02d:%02d %4d\n",
        $ARGV[0],
        (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],
        (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon],
        $mday, $hr, $min, $sec, 1900 + $year;

-- Anthony J. Guzzi
Solutions Engineer
Storability, Incorporated

www.storability.com
The Leading Provider of Automated Storage Assurance for the Global 
Enterprise
--=_alternative 005AD98E85256A0A_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">For those of us who are really lazy and dont 
want to get the modules, the following Perl code program produces the same 
output as the 'bpdbm -ctime' command:</font>
<br>
<br><font size=2 face="Courier">#!/usr/local/bin/perl</font>
<br><font size=2 
face="Courier">($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = 
localtime($ARGV[0]);</font>
<br><font size=2 face="Courier">printf &quot;%d = %s %s %2d %2d:%02d:%02d 
%4d\n&quot;,</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; $ARGV[0],</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; 
(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; 
(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon],</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; $mday, $hr, $min, 
$sec, 1900 + $year;</font>
<br><font size=2 face="sans-serif"><br>
-- Anthony J. Guzzi<br>
Solutions Engineer</font>
<br><font size=2 face="sans-serif">Storability, Incorporated</font>
<br>
<br><font size=2 face="sans-serif">www.storability.com</font>
<br><font size=2 face="sans-serif">The Leading Provider of Automated Storage 
Assurance for the Global Enterprise</font>
--=_alternative 005AD98E85256A0A_=--



<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] Re: converting unix time, anthony . guzzi <=