PHP MySQL时间查询

I have one question.

So the record in mysql table is like:

2014-04-01 15:04:39

And all queries are made by url through $_GET in my example fromhour....

This is the input:

echo "<input type='time' placeholder='From...'  name='fromhour' id='basicExample' >";

This is the function for creating MySQL query.

if (isset($data['fromhour']))
{
    $where[] = "RIGHT (calldate, 8) <= '" . $data['fromhour'];
    if ($mode == 'count')
        $used_params[] = 'fromhour=' . $data['fromhour'];
}

Now when i put in for example 04:00:00 the url becomes:

http://xxx.xxx.xxx.xxx/index.php?fromhour=04%3A00%3A00

is there anyway that i can parse or anything so that query in mysql wouldt be 04%3A00%3A00 but 04:00:00?

And this is where I merge the SQL query:

$sql = 'SELECT * FROM test';
    if (count($where) > 0)
        $sql .= ' WHERE ' . implode(' AND ', $where);

Thanks in advance...

You could use php's urldecode before creating the query

$nicetime=urldecode('04%3A00%3A00')

> '04:00:00'