I'm using PHP v4.3.9
Using the PEAR Date library
$_REQUEST holds three variables (comes from a Javascript calendar) that define the date. I turn them into one string via sprintf, then get a new Date object.
Code: Select all
$x = sprintf("%s-%s-%s", $_REQUEST['y'], $_REQUEST['m'], $_REQUEST['d'] ) ;
$targetDate = new Date( $x ) ; What is baffling me is that if I simply say...
Code: Select all
$x = "2007-01-01";
$targetDate = new Date( $x ) ;Thank you for any assistance. I've looked around for information that would help me but I find I'm just beating my head against the wall.