PDA

View Full Version : php date


pugs1501
12-19-2006, 03:13 PM
I was wondering if any one could help me. I am trying to get a lunch menu to show up on my website. I have finally got it to show this months menu but I was wondering how do i get it to show next months. I am using the command $menudate = date("My"); for this months because the file name is Dec06-Lunch.pdf And next months file looks like this Jan07-Lunch.pdf and I want to show this months and next months menus. I have tried $lastmonth = mktime(0, 0, 0, date("M")+1, date("Y")); but all it gives me is the exact date which is 1309323600 but I want it to give me Jan07 so i can add it to -Lunch.pdf so the website updates it self each month. Any help would be wonderful.

hrethan
12-28-2006, 03:59 PM
You're almost there. Take that ugly number (1309...) and assign it to a variable, then call date("My") on that. Something like
$nextMonthsMenu = date("My", $lastmonth) . "-Lunch.pdf";

HTH.