|
 |
|
ติดปัญหาเกี่ยวกับการวันที่ครับ รวบกวนช่วยหน่อยครับ |
|
 |
|
|
 |
 |
|
$d = "2009-12-31"; // form your database
$array = explode("-", $d);
$after = date("Y-m-d", mktime(0, 0, 0, $array[1], $array[2] + 1, $array[0]));
echo "Day after add a day " . $after;
//ที่นี้เดือนไหน มี 31 วันละก็ บวกเพิ่มไปอีกหนึ่งวันก็จะได้เป็น วันที่ 1 ของเดือนถัดไปแล้วครับ รวมทั้ง ปี พ.ศ. ด้วย หากเป็น 31 ธันวา ก็จะขึ้นเป็น วันที่ 1 ของเดือนแรก ปีถัดไปเลยครับ
|
 |
 |
 |
 |
Date :
2009-09-24 13:51:48 |
By :
joekung |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$d = "2009-12-31"; // form your database
$array = explode("-", $d);
$after = date("Y-m-d", mktime(0, 0, 0, $array[1], $array[2] + 1, $array[0]));
echo "Date after Add a day " . $after;
//ที่นี้เดือนไหน มี 31 วันละก็ บวกเพิ่มไปอีกหนึ่งวันก็จะได้เป็น วันที่ 1 ของเดือนถัดไปแล้วครับ รวมทั้ง ปี พ.ศ. ด้วย หากเป็น 31 ธันวา ก็จะขึ้นเป็น วันที่ 1 ของเดือนแรก ปีถัดไปเลยครั
ปล ตัวก่อนนั้น มี code color ติดไปด้วย
|
 |
 |
 |
 |
Date :
2009-09-24 13:53:03 |
By :
joekung |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$date1 = date("Y-m-d");
$date2 =date("Y-m-d", strtotime("+1 day",strtotime($date1))); // บวก 1 วัน
|
 |
 |
 |
 |
Date :
2009-09-24 13:58:18 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณทุกท่านครับ
เดี๋ยวไปลองใช้ดูครับผม
|
 |
 |
 |
 |
Date :
2009-09-24 14:26:34 |
By :
jinntake2 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|