|
 |
|
อยากถามเรื่อง เช็คเวลา คือผมจะใช้ว่า ถ้าหากเกิน 24 ชม . แก้ไขไม่ได้ออ่ะคับ ไม่ทราบว่าใช้ฟังชั่นอะไร |
|
 |
|
|
 |
 |
|
<?php $mx = date('Y-m-d');?>
ลองแบบนี้ดูครับ
|
 |
 |
 |
 |
Date :
2009-10-21 14:40:32 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
function DateTimeDiff($strDateTime1,$strDateTime2)
{
return (strtotime($strDateTime2) - strtotime($strDateTime1))/ ( 60 * 60); // 1 Hour = 60*60
}
?>
<?php echo $mm = "2009/10/20 20:20:20";?><br /> // ดึงจากฐานข้อมูล ที่เก็บแบบ datetime ได้เลย
<?php echo $mx = date("Y/m/d H:i:s");?><br />
<?php $date = DateTimeDiff($mm,$mx) ;?>
<?php echo $date; ?>
|
 |
 |
 |
 |
Date :
2009-10-21 14:53:43 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|