|
 |
|
ถึงท่านเทพทั้งหลายช่วยผมหน่อยค๊าบ คือผมต้องการ สคริป ที่แสดงคำว่า เหลือเวลาอีก...วัน ...ชั่วโมง |
|
 |
|
|
 |
 |
|

ป่านนี้เทพทั้งหลายคงไปเฝ้าเทพสูงสุดกันอยู่อ่ะครับ
ผมก็ไม่ไหวแล้วเหมือนกัน สมองไม่สั่งงานแล้วครับ
เดี๋ยวตื่นมาค่อยว่ากันครับ
ขออภัยมา ณ. ที่นี้

|
 |
 |
 |
 |
Date :
2009-10-13 02:29:54 |
By :
suriya_puk |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ค๊าบผม มะเป็นไรคับ
|
 |
 |
 |
 |
Date :
2009-10-13 02:33:28 |
By :
Pacharab |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอานี่ไปดูนะครับ
Code (PHP)
$t_db=1255391083+86400; //ใส่เป็นค่าเวลาแบบ time() แล้วทำการ + เพิ่มเข้าไปครับ เช่น 60*60*24 = 86400 หรือ 1 วัน
$n_tm=time();
$com=$n_tm-$t_db;
$fix_dat=(60*60)*24;
$fix_hr=(60*60);
##################################
### วันที่
$val=($com/$fix_dat);
$com_day=substr($val,0,strpos($val,"."));
##################################
#################################
#### ชั่วโมง
if($com_day==0)
{$com_hr=($com/$fix_hr);}
else
{$com_hr=($com%$fix_dat)/$fix_hr;}
$com_hr=substr($com_hr,0,strpos($com_hr,"."));
##################################
$com_min=round((($com%$fix_dat)%$fix_hr)/60);
$com_hr=substr("00",0,2-strlen($com_hr)).$com_hr;
$com_min=substr("00",0,2-strlen($com_min)).$com_min;
echo substr($com_day,strpos($com_day,'-')+1)." วัน : ".substr($com_hr,2)." ชั่วโมง : ".substr($com_min,2)." นาที ";
|
 |
 |
 |
 |
Date :
2009-10-13 07:14:45 |
By :
siammbk |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้ก็ได้ครับ ก๊อปแล้วสามารถรันดูได้ครับ
$t_db=1255391083+86400; //ใส่เป็นค่าเวลาแบบ time() แล้วทำการ + เพิ่มเข้าไปครับ เช่น 60*60*24 = 86400 หรือ 1 วัน
$n_tm=time();
$com=$n_tm-$t_db;
$fix_dat=(60*60)*24;
$fix_hr=(60*60);
##################################
### วันที่
$val=($com/$fix_dat);
$com_day=substr($val,0,strpos($val,"."));
##################################
#################################
#### ชั่วโมง
if($com_day==0)
{$com_hr=($com/$fix_hr);}
else
{$com_hr=($com%$fix_dat)/$fix_hr;}
$com_hr=substr($com_hr,0,strpos($com_hr,"."));
##################################
$com_min=round((($com%$fix_dat)%$fix_hr)/60);
$com_hr=substr("00",0,2-strlen($com_hr)).$com_hr;
$com_min=substr("00",0,2-strlen($com_min)).$com_min;
echo substr($com_day,strpos($com_day,'-')+1)." วัน : ".substr($com_hr,2)." ชั่วโมง : ".substr($com_min,2)." นาที ";
|
 |
 |
 |
 |
Date :
2009-10-13 07:16:08 |
By :
siammbk |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มาช่วยแต่เช้า
|
 |
 |
 |
 |
Date :
2009-10-13 08:00:52 |
By :
gummezaka |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอ็มเดี้ยงอะ
|
 |
 |
 |
 |
Date :
2009-10-13 08:05:16 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Goodmorning Ja..
|
 |
 |
 |
 |
Date :
2009-10-13 08:10:17 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

คนนี้เขาบอกคิดถึงแป๊ะหละ ฮิฮิ
|
 |
 |
 |
 |
Date :
2009-10-13 09:52:25 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555555555 พี่เดียวละก็
|
 |
 |
 |
 |
Date :
2009-10-13 10:17:05 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หล่นชื่อ"ผีขนุนใช่มั้ยพี่เดี่ยว"
  งั้นก็บ๊ายบายหล่ะ 
|
 |
 |
 |
 |
Date :
2009-10-13 10:32:20 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สวัสดียามเช้าคับทุกคน
ขอบคุณมากน่ะคับ ที่เข้ามาช่วยดูให้คับ
|
 |
 |
 |
 |
Date :
2009-10-13 10:44:43 |
By :
Pacharab |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอ้า ฮาเฮยามเช้ากันหน่อยเร๊ว กาแฟคาปูชิโน สักแก้วกันเหอะเรา
ล้อเล่นเน่อน้องแป๊ะ ห้ามเคียดอ้ายเด้อ
|
 |
 |
 |
 |
Date :
2009-10-13 10:59:27 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่รู้ว่ามันเป็นอะไรอ่าคับ
มันไม่ขึ้นอะไรเลยคับ ช่วยแนะนำหน่อยนะคับ
|
 |
 |
 |
 |
Date :
2009-10-13 13:55:32 |
By :
Pacharab |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันไหนที่ว่าไม่ขึ้นหรอครับ 
|
 |
 |
 |
 |
Date :
2009-10-13 14:00:43 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้อ่าคับ
$t_db=1255391083+86400; //ใส่เป็นค่าเวลาแบบ time() แล้วทำการ + เพิ่มเข้าไปครับ เช่น 60*60*24 = 86400 หรือ 1 วัน
$n_tm=time();
$com=$n_tm-$t_db;
$fix_dat=(60*60)*24;
$fix_hr=(60*60);
##################################
### วันที่
$val=($com/$fix_dat);
$com_day=substr($val,0,strpos($val,"."));
##################################
#################################
#### ชั่วโมง
if($com_day==0)
{$com_hr=($com/$fix_hr);}
else
{$com_hr=($com%$fix_dat)/$fix_hr;}
$com_hr=substr($com_hr,0,strpos($com_hr,"."));
##################################
$com_min=round((($com%$fix_dat)%$fix_hr)/60);
$com_hr=substr("00",0,2-strlen($com_hr)).$com_hr;
$com_min=substr("00",0,2-strlen($com_min)).$com_min;
echo substr($com_day,strpos($com_day,'-')+1)." วัน : ".substr($com_hr,2)." ชั่วโมง : ".substr($com_min,2)." นาที ";
หรือว่าผมทำผิดอะไรหรือป่าวกไม่รู้ ช่วยแนะนำหน่อยน่ะคับ
|
 |
 |
 |
 |
Date :
2009-10-13 14:14:12 |
By :
Pacharab |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$t_db=1255391083+86400; //ใส่เป็นค่าเวลาแบบ time() แล้วทำการ + เพิ่มเข้าไปครับ เช่น 60*60*24 = 86400 หรือ 1 วัน
$n_tm=time();
$com=$n_tm-$t_db;
$fix_dat=(60*60)*24;
$fix_hr=(60*60);
##################################
### วันที่
$val=($com/$fix_dat);
$com_day=substr($val,0,strpos($val,"."));
##################################
#################################
#### ชั่วโมง
if($com_day==0)
{$com_hr=($com/$fix_hr);}
else
{$com_hr=($com%$fix_dat)/$fix_hr;}
$com_hr=substr($com_hr,0,strpos($com_hr,"."));
##################################
$com_min=round((($com%$fix_dat)%$fix_hr)/60);
$com_hr=substr("00",0,2-strlen($com_hr)).$com_hr;
$com_min=substr("00",0,2-strlen($com_min)).$com_min;
echo substr($com_day,strpos($com_day,'-')+1)." วัน : ".substr($com_hr,2)." ชั่วโมง : ".substr($com_min,2)." นาที ";
ดูที่นี่ครับ
$t_db=1255391083+86400; //ใส่เป็นค่าเวลาแบบ time() แล้วทำการ + เพิ่มเข้าไปครับ เช่น 60*60*24 = 86400 หรือ 1 วัน
ตัวแปล $t_db; ตัวนี้จะเก็บค่าของ time();
ให้ลอง echo $time(); สมุดว่าได้เลข 1255391083 อันนี้ก็คือล้เวลาล่าสุด แล้วนำเก็บไว้ที่ตัวแปล $t_db=1255391083;
แล้วต่อไปเราจะต้องการเวลากี่วันก็คำนวนโดยหาค่าวัน (60*60)*24 = 1 วัน
ก็เอาตัวแปล $t_db=1255391083+(60*60)*24;
ลองดูนะครับอยู่ที่ตัวตั้งค่าเท่านั้นเอง
|
 |
 |
 |
 |
Date :
2009-10-14 01:01:56 |
By :
siammbk |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|