|
|
|
ต้องการหาระยะห่างของเวลาค่ะ เวลาที่กำหนด $stime = "08:00:00";ลงเวลาเข้า$wtime = "08 |
|
|
|
|
|
|
|
ฟังก์ชั่นครับ ลองเอาไปแกะดูเอาเองเด้อ
function TimeDiff($Timestart,$Timeend){
$mk_data=mktime(date("H",strtotime($Timestart)),date("i",strtotime($Timestart)),date("s",strtotime($Timestart)),date("m",strtotime($Timestart)),date("d",strtotime($Timestart)),date("Y",strtotime($Timestart)));
$mk_data2=mktime(date("H",strtotime($Timeend)),date("i",strtotime($Timeend)),date("s",strtotime($Timeend)),date("m",strtotime($Timeend)),date("d",strtotime($Timeend)),date("Y",strtotime($Timeend)));
$mk_data3=($mk_data2-$mk_data);
$days=intval($mk_data3/86400);
$remain=$mk_data3%86400;
$hours=intval($remain/3600);
$remain=$remain%3600;
$mins=intval($remain/60);
$secs=$remain%60;
return $days." วัน ".$hours." ชั่วโมง ".$mins." นาที ".$secs." วินาที";
}
|
|
|
|
|
Date :
2010-02-22 16:51:00 |
By :
kalamell |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|