A function encyclopedia that SQL Server converts dates into strings of different formats

Source: Internet
Author: User

SQL statement Results
SELECT CONVERT (varchar ( -), GETDATE (), 0)--10:57am
SELECT CONVERT (varchar), GETDATE (), 1)--05/03/10
SELECT CONVERT (varchar), GETDATE (), 2)--10.05.03
SELECT CONVERT (varchar), GETDATE (), 3)--03/05/10
SELECT CONVERT (varchar), GETDATE (), 4)--03.05.10
SELECT CONVERT (varchar), GETDATE (), 5)--03-05-10
SELECT CONVERT (varchar), GETDATE (), 6)--03 05 10
SELECT CONVERT (varchar), GETDATE (), 7)--05 03, 10
SELECT CONVERT (varchar), GETDATE (), 8)--10:57:46
SELECT CONVERT (varchar), GETDATE (), 9)--10:57:46:827am
SELECT CONVERT (varchar), GETDATE (), 10)--05-03-10
SELECT CONVERT (varchar), GETDATE (), 11)--10/05/03
SELECT CONVERT (varchar), GETDATE (), 12)--100503
SELECT CONVERT (varchar), GETDATE (), 13)--03 05 2010 10:57:46:937
SELECT CONVERT (varchar), GETDATE (), 14)--10:57:46:967
SELECT CONVERT (varchar), GETDATE (), 20)--2010-05-03 10:57:47
SELECT CONVERT (varchar), GETDATE (), 21)--2010-05-03 10:57:47.157
SELECT CONVERT (varchar), GETDATE (), 05/03/10 10:57:47 AM
SELECT CONVERT (varchar), GETDATE (), 23)--2010-05-03
SELECT CONVERT (varchar), GETDATE (), 24)--10:57:47
SELECT CONVERT (varchar), GETDATE (), 25)--2010-05-03 10:57:47.250
SELECT CONVERT (varchar), GETDATE (), (+)--10:57am
SELECT CONVERT (varchar), GETDATE (), 101)--05/03/2010
SELECT CONVERT (varchar), GETDATE (), 102)--2010.05.03
SELECT CONVERT (varchar), GETDATE (), 103)--03/05/2010
SELECT CONVERT (varchar), GETDATE (), 104)--03.05.2010
SELECT CONVERT (varchar), GETDATE (), 105)--03-05-2010
SELECT CONVERT (varchar), GETDATE (), 106)--03 05 2010
SELECT CONVERT (varchar), GETDATE (), 107)--05 03, 2010
SELECT CONVERT (varchar), GETDATE (), 108)--10:57:49
SELECT CONVERT (varchar), GETDATE (), 109)--10:57:49:437am
SELECT CONVERT (varchar), GETDATE (), 110)--05-03-2010
SELECT CONVERT (varchar), GETDATE (), 111)--2010/05/03
SELECT CONVERT (varchar), GETDATE (), 112)--20100503
SELECT CONVERT (varchar), GETDATE (), 113)--03 05 2010 10:57:49:513
SELECT CONVERT (varchar), GETDATE (), 114)--10:57:49:547
SELECT CONVERT (varchar), GETDATE (), 120)--2010-05-03 10:57:49
SELECT CONVERT (varchar), GETDATE (), 121)--2010-05-03 10:57:49.700
SELECT CONVERT (varchar), GETDATE (), 126)--2010-05-03t10:57:49.827
SELECT CONVERT (varchar), GETDATE (),--???? ?????? 1427 10:57:49:907am
SELECT CONVERT (varchar), GETDATE (), 131)--18/04/1427 10:57:49:920am

A function encyclopedia that SQL Server converts dates into strings of different formats

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.