PHP Format Date

Source: Internet
Author: User
Tags echo date odbc

century Digit (yy) with century digit (yyyy)
Standard
Input/Output * *
-0 or 100 (*) default value mon dd yyyy hh:miam (or PM)
1 101 American Mm/dd/yyyy
2 102 ANSI Yy.mm.dd
3 103 British/French DD/MM/YY
4 104 German Dd.mm.yy
5 105 Italian Dd-mm-yy
6 106-dd Mon yy
7 107-mon DD, yy
8 108-HH:MM:SS
-9 or 109 (*) default + millisecond Mon dd yyyy hh:mi:ss:mmmAM (or PM)
10 110 American Mm-dd-yy
11 111 Japanese Yy/mm/dd
112 ISO YYMMDD
-13 or 113 (*) Euro defaults + millisecond dd Mon yyyy hh:mm:ss:mmm (24h)
114-hh:mi:ss:mmm (24h)
-20 or (*) ODBC specification YYYY-MM-DD HH:MM:SS[.FFF]
-21 or 121 (*) ODBC specification (with milliseconds) Yyyy-mm-dd HH:MM:SS[.FFF]
-126 (* * *) ISO8601 yyyy-mm-dd Thh:mm:ss:mmm (without spaces)
-130* Kuwait DD Mon yyyy Hh:mi:ss:mmmAM
-131* Kuwaiti Dd/mm/yy Hh:mi:ss:mmmAM

Select CONVERT (char, data) from table;

The results shown are: APR 8 2002 12:00AM

SELECT convert (char, data, the) from table;

The results displayed are: 2002-04-08 00:00:00

echo Date ("Y-m-d", Strtotime ("APR 8 2002 12:00am"));

echo Date ("Y-m-d", Strtotime ("2002-04-08 00:00:00"));




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.