Jump to content

[SOLVED] Date month format


gazever

Recommended Posts

I am creating an avaliability calendar, however I am using a flat file database, as my client doesn't have SQL installed on his host. I have created some loops to show through 12 calendars for each house he has avaliable to rent. I get the current month by using the date as in code below and have a different txt file for each month which it loads then outputs a table calendar according to its state, booked, avaliable etc as a td css class.

 

$start = date('m');
$start ++;
$start --;

 

However I increase it by one then decrease it by one to get rid of the prevailing zero, is there a better way to do this? Or can I keep the prevailing zero and increment 1 each time keeping it as it should be, 02, 03, 04 etc by using ++.

 

Hope this makes sense.

 

I haven't been using PHP for very long,

 

Many Thanks

Link to comment
https://forums.phpfreaks.com/topic/38306-solved-date-month-format/
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.