|
Posted by Rik Wasmus on 12/31/07 16:43
On Mon, 31 Dec 2007 17:28:11 +0100, ashore <shoreas@gmail.com> wrote:
> Feature or bug, that's pretty bad (where 'bad' =3D=3D 'non-intuitive')=
..
Well, it's something I rather depend on most of the time actually. How d=
o =
you propose it should handle '31-11-XXXX'? An error/exception perhaps, =
that would be justifiable. Just setting it back to 30-11 would be =
inexcusable.
> While correcting this will prbly break a lot of applications, mebbe
> it's time for another date set of functions.
>
> What DO you guys use to 'go back one month' reliably?
Depends on the use. In some cases, taking 01-12-2007 as one month before=
=
31-12-2007 is just what I want. In your context, why do you bother with =
=
the day part?
print date("M `y", mktime(0, 0, 0, date("m")-1, 1,date("Y")));
-- =
Rik Wasmus
[Back to original message]
|