tags:

views:

14

answers:

1

$s=00:00:00 ( default value in time type filed in database)

if i do $sp=date('g:i A',strtotime($s)); then it return 12:00 AM

i want that if there is a default value in database then it doesn't display any time or make it blank for further use

+1  A: 
$time = strtotime($s);
if($s == "00:00:00")
{
    // default time
}
else
{
    $sp = date("g:i A", strtotime($s));
}

Just to make sure you know, 00:00:00 is 12:00 AM. More specifically, it is Janurary 1st, 1970, 12:00 AM.

Chacha102
Thank You Sir, will u please see my last two problem about time datatype field in mysql
diEcho