Jump to content

mktime


prudens

Recommended Posts

Hi.

 

$yesterday=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));

 

 

I have a question, I used a "date("d")-1" in the above expression to indicate yesterday. It works well with almost everything, but I wonder if it will work with say, 05-01-08, or 06-01-08? The first day of months... because 01 - 1 is 00... does PHP auto adjust that or I have to do it manually?

Link to comment
https://forums.phpfreaks.com/topic/108793-mktime/
Share on other sites

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.