php compare date function

Associate
Joined
25 Aug 2004
Posts
163
Location
Reading
Does anyone know of a good php function or method to get whether a given date is within a given time period that is not static? I.e. date() is used in order to get the current date and state whether that is within a specific date period.

I've tried the strtotime function to timestamp and compare 4 different time periods, I just can't seem to get it right as the year on the given time periods will change based on the current year. I only seem to be able to compare static time periods- think I'm being quite stupid!

Any ideas?

Cheers :confused:
 
I've been doing this recently with some room booking software I've been writing and I used mktime() and used variables for the attributes-

Code:
mktime(0,0,0,$month,$day,$year);

And then use strftime() to format it to a readable date again if needed :) :cool:
 
Back
Top Bottom