vennirajan has asked for the wisdom of the Perl Monks concerning the following question:
I have a problem with the DateTime::Precise module. I have created the object with the following parameters.
The problem i am facing here is, when i increment the month by 1, it increments the date by 31 days and so it gets the date 2/31. But which is not a valid date. So, perl compensates by converting the days over into the next month. So 2/31 becomes 3/3.
I have put this piece of code in another script which processes the records from the text file. I am facing this problem only when create the object from the January month having the date > 29.
Can any one tell me how to get the correct month value when i do inc_month from the January object (having the $date >29 )?
I can put a if condition to check the january objects.But, I am still trying to solve it through the module's methods.
Have any of you faced this problem ? Any help would be highly appreciated.
Thanks for your valuable time.
Regards,
S.Venni Rajan.
"A Flair For Excellence."
BK Systems.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get the correct incremented month through DateTime::Precise ?
by davorg (Chancellor) on Oct 16, 2006 at 10:18 UTC | |
|
Re: How to get the correct incremented month through DateTime::Precise ?
by ashokpj (Hermit) on Oct 16, 2006 at 11:18 UTC | |
by davorg (Chancellor) on Oct 16, 2006 at 11:43 UTC |