Click to See Complete Forum and Search --> : How do I test for current date bewteen 2 given dates?


MaxDax
12-06-2003, 05:21 PM
Hi
How do I test if a date is between two given dates?

eg. Is current date between 1st dec & 31st dec

Is there a 'between date range' function I have missed somewhere or do I have to test to see if current date is greater equal than 1st dec and then test to see if current date is less equal than 31st dec?

If this is the case, what do I use to construct the limiting dates?

Can anyone give me a clue?

Thanks
MaxDax

pyro
12-06-2003, 05:25 PM
Yes, you will have to check if it is greater than the first, and less than the second. What you want to do is convert all dates that you are compairing to timestamps - much easier to use. Take a look at mktim() (http://us3.php.net/manual/en/function.mktime.php).

MaxDax
12-06-2003, 05:45 PM
Thanks, that's clue enough.

Now I know where to play in the playground :))

Cheers
MaxDax

pyro
12-06-2003, 06:23 PM
Lol... Ok, have fun. :) If you need any more help, just holler.