Teknik Rahasia Puaskan Istri 100% Tanpa Obat, Mudah Murah Nyata, Buktikan !!! klik disini

Selisih jam awal dan akhir

$skrg = mktime(date("H")-1,date("i"),date("s"),date("m"),date("j"),date("Y"));
$tglAwal=date("Y-m-j H:i:s", $skrg);

$tglAkhir = "2010-05-26 00:00:00";

mysql_connect("localhost","root","pass");
mysql_select_db("tokobukudb");

$query = "SELECT timediff('$tglAkhir', '$tglAwal') as selisih";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$selisih=$data['selisih'];
$jam=substr($selisih,0,2);
$mnt=substr($selisih,3,2);
$dtk=substr($selisih,6,2);
if ($dtk==59)
{
echo " Malam ";
}
else {
echo "Selisih antara jam ".$tglAwal."";
echo "sampai dengan jam “.$tglAkhir.” adalah “.$data['selisih'].” menit”;
echo “
selisih : $selisih”;
echo “
“.$jam.” jam “.$mnt.” menit “.$dtk.” detik “;
echo “

” ;
}
?>


Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically each day to your feed reader.

Trackbacks & Pingbacks

No trackbacks/pingbacks yet.

Comments

Manteps… makasih pa ilmunya … salam kenal

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)