| unix2dos() | ใช้แปลง Unix Timestamp ไปเป็น Dos Timestamp |
|---|---|
| dos2unix() | ใช้แปลง Dos Timestamp ไปเป็น Unix Timestamp |
| seconds() | ใช้คืนค่า array ของวินาที ตาม step ที่กำหนด และสามารถกำหนด วินาทีที่เริ่ม และสิ้นสุดได้ด้วย |
| minutes() | ใช้คืนค่า array ของนาที ตาม step ที่กำหนด และสามารถกำหนด นาทีที่เริ่ม และสิ้นสุดได้ด้วย |
| hours() | ใช้คืนค่า array ของชั่วโมง ตาม step ที่กำหนด และสามารถกำหนด ชั่วโมงที่เริ่ม และสิ้นสุดได้ด้วย |
| ampm() | ใช้คืนค่า ว่า ชั่วโมงที่กำหนด นั้น เป็น am หรือ pm |
| days() | ใช้คืนค่า array ของวัน ซึ่งจำนวนของวันที่คืนมา จะเป็นจำนวนวัน ของเดือนและปีที่กำหนด |
| months() | ใช้คืนค่า array ของเดือน ( จำนวนของเดือน ) |
| years() | ใช้คืนค่า array ของปี ตามจำนวนปีที่กำหนด |
| timespan() | ใช้คืนค่า array ที่เป็นค่าความแตกต่างของ 2 timestamp โดยมี key ตามที่กำหนดใน format |
| adjust() | ใช้แปลงค่าชั่งโมงไปเป็น am หรือ pm ที่กำหนด |
method:unix2dos ( timestamp );
return type:int
special:static
content:ใช้แปลง Unix Timestamp ไปเป็น Dos Timestamp
example:$unix_timestamp = date (); echo date::unix2dos ( $unix_timestamp );
method:dos2unix ( timestamp );
return type:int
special:static
content:ใช้แปลง Dos Timestamp ไปเป็น Unix Timestamp
example:$unix_timestamp = date (); $dos_timestamp = date::unix2dos ( $unix_timestamp ); echo date::dos2unix ( $dos_timestamp );
method:seconds ( step, start, end );
return type:array
special:static
content:ใช้คืนค่า array ของวินาที ตาม step ที่กำหนด และสามารถกำหนด วินาทีที่เริ่ม และสิ้นสุดได้ด้วย
example:print_r ( date::seconds () );
comment:ตัวแปร step มีค่า default = 1 ตัวแปร start มีค่า default = 0 ตัวแปร end มีค่า default = 60
method:minutes ( step, start, end );
return type:array
special:static
content:ใช้คืนค่า array ของนาที ตาม step ที่กำหนด และสามารถกำหนด นาทีที่เริ่ม และสิ้นสุดได้ด้วย
example:print_r ( date::minutes () );
comment:ตัวแปร step มีค่า default = 1 ตัวแปร start มีค่า default = 0 ตัวแปร end มีค่า default = 60
method:hours ( step, 24HR, end );
return type:array
special:static
content:ใช้คืนค่า array ของชั่วโมง ตาม step ที่กำหนด และสามารถกำหนด ชั่วโมงที่เริ่ม และสิ้นสุดได้ด้วย
example:print_r ( date::hours () );
comment:ตัวแปร step มีค่า default = 1 ตัวแปร 24HR ใช้กำหนดว่า นับชั่วโมงแบบ 24 ชั่วโมงหรือไม่ มีค่า default คือ false ตัวแปร start มีค่า default = 1
method:ampm ( hour );
return type:string
special:static
content:ใช้คืนค่า ว่า ชั่วโมงที่กำหนด นั้น เป็น am หรือ pm
example:echo date::ampm ( date("G") );
method:days ( month, year );
return type:array
special:static
content:ใช้คืนค่า array ของวัน ซึ่งจำนวนของวันที่คืนมา จะเป็นจำนวนวัน ของเดือนและปีที่กำหนด
example:print_r ( date::days ( 2 ) );
comment:ตัวแปร year มีค่า default คือ ปีปัจจุบัน
method:months ();
return type:array
special:static
content:ใช้คืนค่า array ของเดือน ( จำนวนของเดือน )
example:print_r ( date::months () );
method:years ( start, end );
return type:array
special:static
content:ใช้คืนค่า array ของปี ตามจำนวนปีที่กำหนด
example:print_r ( date::years () );
comment:ตัวแปร start มีค่า default คือ ปีปัจจุบัน ลบ ห้า ตัวแปร end มีค่า default คือ ปีปัจจุบัน บวกห้า
method:timespan ( timestamp_1, timestamp_2, format );
return type:array
special:static
content:ใช้คืนค่า array ที่เป็นค่าความแตกต่างของ 2 timestamp โดยมี key ตามที่กำหนดใน format
example:$format = "weeks, days"; $differ = date::timespan ( 100000, 2000000, $format ); echo $differ["weeks"]; echo $differ["days"];
comment:ตัวแปร format มีค่าที่เป็นไปได้ ได้แก่ years, months, weeks, days, hours, minutes, seconds
method:adjust ( hours, ampm );
return type:int
special:static
content:ใช้แปลงค่าชั่งโมงไปเป็น am หรือ pm ที่กำหนด
example:echo date::adjust ( date("G"), "am" );
comment:ตัวแปร ampm มีค่าที่เป็นไปได้ ได้แก่ "am" หรือ "pm"