in reply to Re^6: Finding End of Month's date
in thread Finding End of Month's date
I'd've expected your snippet to produce June 15 when given May 16 as a start date. It's not obvious why it produces May 31 instead.
Actually, if you give it "May 16" as arguments, it will produce 31 as the answer. Why? Because the original question stated the problem as given a month and a year. So, my snippet takes a month and a year, and hence "May 16" will be the month of May in the year 16.
And if you give ParseDate incomplete dates, it assumes defaults. Like oh, the first second (00), the first minute (00), the first hour (00) and the first day (1). Exactly what I expect. BTW, Date::Time uses the same defaults.
and because the API is terrifically slick
Oh, the irony. The irony. The API specially allows chaining mutators - and your example makes use of them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Finding End of Month's date
by Aristotle (Chancellor) on Jan 04, 2005 at 19:09 UTC | |
by Anonymous Monk on Jan 05, 2005 at 10:48 UTC |