logo       
Google Custom Search
    AddThis Social Bookmark Button

RE: Converting dates from seconds since epoch into regular form: msg#00159

Subject: RE: Converting dates from seconds since epoch into regular form
Hi Timothy.

This would help in your strives for dates and times.. ;)

#!/bin/perl -w

use Time::Local;
use strict;

my $t;

if ($ARGV[0] =~ /^(\d{10})/) {
$t = $1;
}

my($sec, $min, $hour, $mday, $mon, $year) =
    localtime($t);

printf("%02d.%02d.%02d  %02d:%02d:%02d \n",
                $mday, $mon+1, $year + 1900,
                $hour, $min, $sec       );

Run the script with your epoch time as an argument.

//Anders

At 18:11 02/08/2002, Timothy Johnson wrote:

perldoc -f localtime

You don't need to install a module, it's built into Perl.

-----Original Message-----
From: Alan Hogue [mailto:eahogue@xxxxxxxxx]
Sent: Friday, August 02, 2002 10:00 AM
To: perl
Subject: Converting dates from seconds since epoch into regular form


Hi,

I know how to take a given date and turn it into the number of seconds
since the epoch, but I can't figure out how to take a date in this form
and turn it back into a human-friendly format. I have looked around the
date::manip and date::calc modules but don't seem to see anything that
specifically does this. Am I missing something?

Alan

=====
"Do I repeat myself? Very well, I repeat myself; I am repetitive."

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>