Date format conversion for database _php tutorial

Source: Internet
Author: User
As long as you specify a date format in convert, the code is sufficient, such as:

Select CONVERT (char), GETDATE (), 101)
Select Emp_id,convert (char), hire_dt,101) from employee


-----------------------------------------------------

Date format Code
-------------------- -----------
04/05/2000 on 101

-------------------- -----------
2000.04.05 on 102

-------------------- -----------
05/04/2000 on 103

-------------------- -----------
05.04.2000 104

-------------------- -----------
05-04-2000 on 105

-------------------- -----------
APR 2000 106

-------------------- -----------
APR 05, 2000 107

-------------------- -----------
11:33:24 108

-------------------- -----------
APR 5 2000 11:33:24 109

-------------------- -----------
04-05-2000 on 110

-------------------- -----------
2000/04/05 on 111

-------------------- -----------
20000405 112

http://www.bkjia.com/PHPjc/316015.html www.bkjia.com true http://www.bkjia.com/PHPjc/316015.html techarticle as long as you specify the name of the date format in convert, such as: select CONVERT (char (), GETDATE (), 101) Select Emp_id,convert (char (), hire_dt,101) From Employee-----------------------...

  • 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.