RE: Convert date to timestamp
- From: tjohnson@xxxxxxxxxxxx (Timothy Johnson)
- Date: Fri, 2 Dec 2005 12:13:13 -0800
Correction: That line should be:
my $perlTime = timelocal("01","01","01",$day,$month - 1,$year);
^^^^^^^^^^
-----Original Message-----
From: Timothy Johnson
Sent: Friday, December 02, 2005 12:10 PM
To: 'Rafael Morales'; beginners@xxxxxxxx
Subject: RE: Convert date to timestamp
Here's an example:
##################################
use strict;
use warnings;
use Time::Local;
my $textTime = "2005-09-01";
my ($year,$month,$day) = split(/-/,$textTime);
my $perlTime = timelocal("00","00","00",$day,$month,$year);
print "Time: $textTime\n";
print "Perl Time: $perlTime\n";
print "Localtime from Perl Time: ".localtime($perlTime)."\n";
###################################
.
- Follow-Ups:
- Re: Convert date to timestamp
- From: Shawn Corey
- Re: Convert date to timestamp
- Prev by Date: RE: Convert date to timestamp
- Next by Date: Re: Convert date to timestamp
- Previous by thread: RE: Convert date to timestamp
- Next by thread: Re: Convert date to timestamp
- Index(es):
Relevant Pages
|