Return to Snippet

Revision: 1178
at September 21, 2006 07:46 by olive


Initial Code
use Time::Local;
use strict;

my $input="20060920";
my ($year,$month,$day) = (substr($input,0,4),substr($input,4,2),substr($input,6,2));
	
my $timesd = timelocal(0,0,0,$day,$month-1,$year-1900);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($timesd);
print "\n".$mday."-".($mon+1)."-".($year+1900);

Initial URL

                                

Initial Description

                                

Initial Title
transformer une chaine en date

Initial Tags

                                

Initial Language
Perl