I need a date object that has a time of 12:00:00 in the morning for the current day (which means not seconds). I convert this to this number in number of seconds and passing it to another function. It is ultimately used to filter reports using date = "someDateHere" from the database, and hanging seconds in the field spin the report.
I'm not sure what to include the second parameter in the time function - leaving it empty will use the current time, which I do not want. I can not find examples or anything in php doc. If there is another function that will do the job, I will be open to suggestions. It should be simple, but it alludes to me.
date_default_timezone_set('America/Detroit');
$now = date("Y-m-d 0:0:0");
echo $now . '<br/>';
$now = time($now,0);
echo $now . '<br/>';
Thanks in advance.
edit: Note: I need to convert this date object in seconds. It is there that the timestamp wraps me up with the strtotime function and the time function. Despite the fact that I pass it a date object without a timestamp, converting it to seconds is not so convenient, insert the timestamp as the second parameter, which defaults to the current time.
source
share