 |
|
คือจากการทดสอบ วันนี่มันที่ 20 ยังไม่เลยเที่ยงคืนเลย มันเป็นวันที่ 21 ซะเเล้ว
Code (PHP)
<?php
$thai_day_arr=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
$thai_month_arr=array(
"0"=>"",
"1"=>"มกราคม",
"2"=>"กุมภาพันธ์",
"3"=>"มีนาคม",
"4"=>"เมษายน",
"5"=>"พฤษภาคม",
"6"=>"มิถุนายน",
"7"=>"กรกฎาคม",
"8"=>"สิงหาคม",
"9"=>"กันยายน",
"10"=>"ตุลาคม",
"11"=>"พฤศจิกายน",
"12"=>"ธันวาคม"
);
function thai_date($time){
global $thai_day_arr,$thai_month_arr;
$thai_date_return="วัน".$thai_day_arr[date("w",$time)];
$thai_date_return.= "ที่ ".date("j",$time);
$thai_date_return.= " ".$thai_month_arr[date("n",$time)];
$thai_date_return.= " ".(date("Y",$time)+543);
return $thai_date_return;
}
?>
<?php $eng_date=time(); echo thai_date($eng_date);?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2013-06-21 23:45:56 |
By :
biggest59 |
View :
832 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |