input text box2 value e.g 04.00 pm
after submiting, go to the process page to store into mysql
$timefrom=$_POST['time_from'];
$time_from=strtotime($timefrom);
//this is so that i can get the 00:00:00 format coz the data type is TIME in mysql
$time_from=date("h:i:s", $time_from);
$claimquery="INSERT INTO claim VALUES (NULL, '$time_from');
i look at the values in mysql and it is 16:00:00
when i retrieve from it to display using this:
$claimquery="SELECT UNIX_TIMESTAMP(time_from) AS time_from";
$result2=mysql_query($claimquery, $db) or die("Could not execute query");
while($row=mysql_fetch_array($result2))
{
echo "<td>".date("H:i A", $row['time_from'])."</td>";
}
it always shows 8:00 AM.
How come it is not show 4.00 pm?