in reply to Re: Re: Re: where does the time go?
in thread where does the time go?

That gets the month right, but still doesn't take the year into account.

And, as others have stated (but I forgot): if you care about the day as well, then you need to add more code to make sure that "one month before March 31" results in "February 28th or 29th depending on whether it's a leap year" and not "February 31st".

It all depends on what problem you're trying to solve. If all you need is the right month, then your solution works in a clever way. But you're right, it's not the clearest code in the world... :)

Alan