PHP Date Knowledge _php Tutorial

Source: Internet
Author: User
(1) Date
Usage: Date (format, [time]);
If there is no time parameter, the current time is used. The format is a string in which the following characters have special meanings:
U is replaced by the number of seconds since a starting time (as if it were January 1, 1970)

Y Replace with 4-bit era name.
Y Replace with 2-bit era name.
F Replace the full English name of the month.
M replaced by the abbreviation of the month.
M replaced by the number of months.
Z is replaced by the number of days since January 1 of the year.
D replaces the number of Rewardcash octopus.
L Replace the day of the week with the full English name.
D Replace the English abbreviation of the day of the week.
W replaces the Day of the Week (number).
H is replaced by the number of hours (24-hour system).
H is replaced by the number of hours (12-hour system).
I replace it with the number of minutes.
S is replaced by the number of seconds.
A is replaced with "AM" or "PM".
A is replaced with "AM" or "PM".
S replaces the sequential numeric suffix, for example: "St", "nd", "rd", "th".

(2)PHP calculates two time-difference methods

$date =floor ((Strtotime ($enddate)-strtotime ($startdate))/86400);

http://www.bkjia.com/PHPjc/760670.html www.bkjia.com true http://www.bkjia.com/PHPjc/760670.html techarticle (1) Date usage: date (format, [time]); If there is no time parameter, the current time is used. The format is a string in which the following characters have special meanings: U Replace with a starting time (OK ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.