[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem in Date::Manip.pm



El Martes, 30 de Agosto de 2005 12:11, saravanakarthik m escribió:
> hi debian,
> Thank u for u replay.
> actualy i expect the date from 1st century.........not 21st century ie
> year 0005
> month 01
> date 01
> it make problem....so kindly see this

If you only find to format

	00050101
to
	0005/01/01

you don't need any time/date module.

Make
	{
	  my ($year,$month,$day) = $indate =~ /(....)(..)(..)/;
	  $outdate = "$year/$month/$day";
	}


more, see below:

> > >ERROR: Invalid year (4)
> > >      Date::Manip::Date_FixYear(4) called at Date/Manip.pm line 3176
> > >      Date::Manip::Date_WeekOfYear(12, 25, 4, 1) called at
> > >Date/Manip.pm line 1738
> > >      Date::Manip::UnixDate(00050101, '%Y/%m/%d') called at 1.pl line 17
> > >
> > >how can i solve this problem.

I talk to the autor of Date::Manip. It say this problem is solved at 
Date::Manip v5.44, but I see that is not correct.

If you like to use the Date::Manip module, follow this steps:

1. Edit Date/Manip.pm module.
2. Search one line like this:

	$yy--;

3. Change the line to

	$yy = sprintf "%04d", $yy-1;

4. Repeat this step for other line. Date::Manip have two lines with $yy--;
5. Save and Exit for Date/Manip.pm

Now you can execute UnixDate:
$ perl -MDate::Manip -le '$x="00050101"; print UnixDate($x,"%Y/%m/%d" );'
0005/01/01

-- 
______________________________________________________________
Asesora y Proveedora de Servicios de Internet.      Aprosi.Net
jab/msn: explorer@jab.pucela.net           GPG/PGP: 0x42DDB1FE
explorer@pucela.net             http://Pucela.Net/Cultura/Cine
skype: joaquinferrero



Reply to: