ຫົວຂໍ້ຫົວຫຼັກ PHP idate()

ຄວາມຈຳນວນ

ການຈັດຕັ້ງພະຫັດຖັດ/ວັນທີ່ທີ່ຢູ່ນີ້ໃຫ້ເປັນຈຳນວນ.ທົດສອບທັງໝົດຮູບແບບທີ່ຕ່າງກັນ:

<?php
echo idate("B") . "<br>";
echo idate("d") . "<br>";
echo idate("h") . "<br>";
echo idate("H") . "<br>";
echo idate("i") . "<br>";
echo idate("I") . "<br>";
echo idate("L") . "<br>";
echo idate("m") . "<br>";
echo idate("s") . "<br>";
echo idate("t") . "<br>";
echo idate("U") . "<br>";
echo idate("w") . "<br>";
echo idate("W") . "<br>";
echo idate("y") . "<br>";
echo idate("Y") . "<br>";
echo idate("z") . "<br>";
echo idate("Z") . "<br>";
?>

Run Example

Definition and Usage

The idate() function formats local time/date to integer.

Note:The idate() function only accepts one character as format Parameter!

Syntax

idate(format,timestamp);
Parameter Description
format

Required. Specify how to return the result:

  • B - Swatch Beat/Internet Time
  • d - Day of the Month
  • h - Hour (12-hour format)
  • H - Hour (24-hour format)
  • i - Minutes
  • I - Returns 1 if daylight saving time is enabled, otherwise returns 0
  • L - Returns 1 if it is a leap year, otherwise returns 0
  • m - Month Number
  • s - Seconds
  • t - Total Days of the Month
  • U - Seconds Since Unix Epoch (January 1 1970 00:00:00 GMT), Same as time()
  • w - Day of the Week (Sunday is 0)
  • W - Week of the Year in ISO-8601 Format, Starting from Monday
  • y - Year (1 or 2 Digits)
  • Y - Year (4 Digits)
  • z - Day of the Year
  • Z - Time Zone Offset in Seconds
timestamp ທົດຈາຍ. ປະຕິກິດການກໍານົດທີ່ຕ້ອງການກໍານົດວັນ/ເວລາທີ່ຕ້ອງການພິຈາລະນາຈາກ Unix Time Stamp (January 1 1970 00:00:00 GMT). ຄົງທົດສະນະທີ່ມີຢູ່ແມ່ນເວລາທີ່ມື້ນີ້ (time()).

ຂໍ້ມູນດ້ານເຕັກນິກ

ຄືນຕາມລະບຽບ: ກັບຄືນຕາມລະບຽບທີ່ໃຫ້ຂໍ້ສະເໜີ. format ນຳໃຊ້ຕາມລະບຽບທີ່ໃຫ້ຂໍ້ສະເໜີ. timestamp ຈຳນວນສິ່ງທີ່ພິຈາລະນາທີ່ມີຮູບແບບ.
PHP Version: 5+
ບັນທຶກການປັບປຸງ: PHP 5.1.0: ການເພີ່ມ E_STRICT ແລະ E_NOTICE Time Zone Error.