Welcome to the Geeks & God Static Archive. Read more »

Getting Date Range

Joined: 11/28/2008

Hey,

I am trying to retrieve the 1st day of the next month to the last day of that month. But Im struggling to do it. These are going to eventually be a condition on a database query. This is the code I have so far:

This outputs: Live Code

CODE
// current date YYYY-MM-DD
$current_date = date("Y-m-d");
$next_month = date("m") + 1;
$next_month   = date("Y-m-d", mktime(0, $next_month, 0));
echo $next_month;

Ive spent a couple of hours on this now, and Im really struggin, any ideas would be great. thanks.

Joined: 11/28/2008
Check out the PHP docs for

Check out the PHP docs for mktime, specifically the order of arguments!

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
bobbymac @ Jun 8 2007,
QUOTE(bobbymac @ Jun 8 2007, 06:56 AM)
Check out the PHP docs for mktime, specifically the order of arguments!

thanks, ill check that out first hey.