Can anyone tell me why the timestamp generated by the php time() function is so different from SQL datetime?
If i do a date('Y-m-d', time()); in php, it gives me the time now, as it should. If I just take the time() portion and do:
$now = time();
//then execute this statement 'SELECT * FROM `reservation` WHERE created_at < $now'
I get nothing. But hey, so if the value of $now was 1273959833 and I queried
'SELECT * FROM `reservation` WHERE created_at < 127395983300000000'
Then I see the records that ive created. I think one is tracked in microseconds vs the other is in seconds, but I cant find any documentation on this! What would be the right conversion between these two?? any help appreciated.