I am using jquery date picker to grab a date. I then submit the date and I try to format the date to a datetime format so mysql can read. In mysql the column format is a datetime format so I must format to a datetime. I am using cakephp to grab the submitted data. the code looks something like this.
$start = $data['Project']['start_date']; //value is 01/02/2012
$end = $data['Project']['end_date']; // value is 01/26/2012
xdebug_break();
if($data['Project']['start_date'])
$options['conditions'][] = "Project.approval_date >= ".date("Y-m-d H:i:s", $start);
if($data['Project']['end_date'])
$options['conditions'][] = "Project.approval_date <= ".date("Y-m-d H:i:s",$end);
my $options array returns something like this
array(1) (
[conditions] => array(5) (
[Project.user_id] => (string) 9
[Project.project_status] => (string) 1
[Project.project_type_id] => (string) 4
[0] => (string) Project.approval_date >= 1969-12-31 19:00:01
[1] => (string) Project.approval_date <= 1969-12-31 19:00:01
)
)
Where the heck is 1969 coming from
I am using wamp server 2.2. However I believe my clock time is correct because on the front page of my site I am using
<?php print date("F d, Y H:i:s", time());?>
and it grabs the correct time