|
 |
|
ขอถามเรื่องกันแปลงวันที่ในฐานข้อมูลหน่อยครับ คือผมทำเวปขายของเหลือแค่ การออกรายงานก็จะเสร็จแล้วครับ ผมอยากถามว่า |
|
 |
|
|
 |
 |
|
แปลงค่าเวลาในฐานข้อมูลให้เป็นรูปแบบ Unix timestamp ยังไงหรอครับ
|
 |
 |
 |
 |
Date :
2009-02-01 17:35:36 |
By :
iluzid99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้แปลงได้แล้วครับ
|
 |
 |
 |
 |
Date :
2009-02-01 18:08:59 |
By :
iluzid99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นำมาโพสในกระทู้ก็ดีครับ เผื่อสมาชิกอื่น ๆ จะเจอปัญหาเช่นเดียวกันครับ
|
 |
 |
 |
 |
Date :
2009-02-01 19:29:50 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code
<?
$result_1 = mktime(0, 0, 0, $_POST[month_1], $_POST[date_1], $_POST[year_1]); //นำวันเดือนปี 1 มาแปลงเป็นรูปแบบ Unix timestamp
$result_2 = mktime(0, 0, 0, $_POST[month_2], $_POST[date_2], $_POST[year_2]); //นำวันเดือนปี 2 มาแปลงเป็นรูปแบบ Unix timestamp
$timestamp = date("20y-m-d ", $result_1); //แปลงกลับมาเป็น Y-m-d
$timestamp2= date("20y-m-d ", $result_2); //แปลงกลับมาเป็น Y-m-d
?>
ตามนี้ครับ
|
 |
 |
 |
 |
Date :
2009-02-01 20:14:04 |
By :
iluzid99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ผม เซิซตารางออกมาได้แล้วครับ ถ้าผมอยากให้ตารางของผมทั้งหมด เข้าไปในโปรแกม word หรือ Arcobat หรือ Excel สามารถทำได้หรือป่าวครับ หรือต้องออกจากฐานข้อมูลโดยตรงอย่างเดียวครับ
|
 |
 |
 |
 |
Date :
2009-02-01 20:17:18 |
By :
iluzid99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|