Jump to content

[SOLVED] Month before date( "m" )


Mutley

Recommended Posts

mktime() take the hour/min/sec/mon/day/year and returns a timestamp:

http://php.net/mktime

 

it's great cus you can give it numbers that are too big or small and it will compensate. so in january, the code i gave you would get the 0 month of 2009, which it knows is the 12th of 2008.

 

i also just remembered you should be able to do this:

echo date('m',strtotime('-1 month'));

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.