Convert date into a timestamp format
<p>I have the below codes which contain a date.</p>

<pre><code> echo $giorno_selcted;
    $post_date = date("Y-m-d", strtotime(stripslashes($giorno_selcted)));
</code></pre>

<p>$giorno_selected// echoes a date in this format 25-09-2012
$post_date// creates a date in format Y-m-d - 2012-09-25</p>

<p>What i need is to create two variables which will convert the $post_date to a timestamp i.e 2012-09-25 00:00:00 and 2012-09-25 23:59:59</p>

<pre><code>$post_date_start = 2012-09-25 00:00:00
$post_date_finish = 2012-09-25 23:59:59
</code></pre>

<p>Thanks!</p>

<p>I have this query which permits me to print all the information inserted between two timestamps. But i get an error in the syntax which says, 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '00:00:00 AND' at line 1</p>

<p>Here is the code:</p>

<pre><code>$post_date = date("Y-m-d", strtotime(stripslashes($giorno_selcted)));

$time_end = "23:59:59";
$time_start = "00:00:00";
$giorno_timestamp_start=$post_date.' '.$time_end;
$giorno_timestamp_start=$post_date.' '.$time_start;

$information="SELECT * FROM scheda_anagrafica WHERE time_inserted BETWEEN " . $giorno_timestamp_start. " AND ". $giorno_timestamp_end;
</code></pre>

<p>the time_inserted fieldis as a timestamp field..
Thanks</p>
