SQL date format output-go

Source: Internet
Author: User
Tags getdate

SELECT CONVERT (varchar), GETDATE (), 0) 9 9:12am

SELECT CONVERT (varchar), GETDATE (), 1) 05/09/11
SELECT CONVERT (varchar), GETDATE (), 2) 11.05.09
SELECT CONVERT (varchar), GETDATE (), 3) 09/05/11
SELECT CONVERT (varchar), GETDATE (), 4) 09.05.11
SELECT CONVERT (varchar), GETDATE (), 5) 09-05-11
SELECT CONVERT (varchar), GETDATE (), 6) 09 05 11
SELECT CONVERT (varchar), GETDATE (), 7) 05 09, 11
SELECT CONVERT (varchar), GETDATE (), 8) 09:13:14
SELECT CONVERT (varchar), GETDATE (), 9) 9 9:13:14:670am
SELECT CONVERT (varchar), GETDATE (), 10) 05-09-11
SELECT CONVERT (varchar), GETDATE (), 11) 11/05/09
SELECT CONVERT (varchar), GETDATE (), 12) 110509
SELECT CONVERT (varchar), GETDATE (), 13) 09 05 2011 09:13:14:670
SELECT CONVERT (varchar), GETDATE (), 14) 09:13:14:670
SELECT CONVERT (varchar), GETDATE (), 20) 2011-05-09 09:13:14
SELECT CONVERT (varchar), GETDATE (), 21) 2011-05-09 09:13:14.670
SELECT CONVERT (varchar), GETDATE (), 05/09/11 9:15:33 AM
SELECT CONVERT (varchar), GETDATE (), 23) 2011-05-09
SELECT CONVERT (varchar), GETDATE (), 24) 09:15:33
SELECT CONVERT (varchar), GETDATE (), 25) 2011-05-09 09:15:33.140
SELECT CONVERT (varchar), GETDATE (), 9 9:15AM
SELECT CONVERT (varchar), GETDATE (), 101) 05/09/2011
SELECT CONVERT (varchar), GETDATE (), 102) 2011.05.09
SELECT CONVERT (varchar), GETDATE (), 103) 09/05/2011
SELECT CONVERT (varchar), GETDATE (), 104) 09.05.2011
SELECT CONVERT (varchar), GETDATE (), 105) 09-05-2011
SELECT CONVERT (varchar), GETDATE (), 106) 09 05 2011
SELECT CONVERT (varchar), GETDATE (), 107) 05 09, 2011
SELECT CONVERT (varchar), GETDATE (), 108) 09:16:38
SELECT CONVERT (varchar), GETDATE (), 109) 9 9:16:38:543am
SELECT CONVERT (varchar), GETDATE (), 110) 05-09-2011
SELECT CONVERT (varchar), GETDATE (), 111) 2011/05/09
SELECT CONVERT (varchar), GETDATE (), 112) 20110509
SELECT CONVERT (varchar), GETDATE (), 113) 09 05 2011 09:17:19:857
SELECT CONVERT (varchar), GETDATE (), 114) 09:17:19:857
SELECT CONVERT (varchar), GETDATE (), 120) 2011-05-09 09:17:19
SELECT CONVERT (varchar), GETDATE (), 121) 2011-05-09 09:17:19.857
SELECT CONVERT (varchar), GETDATE (), 126) 2011-05-09t09:17:19.857
SELECT CONVERT (varchar), GETDATE (), 6????? ??????? 1432 9:17:19:857am
SELECT CONVERT (varchar), GETDATE (), 131) 6/06/1432 9:17:19:857am

Interception time is the part of the month day

selectstuff(CONVERT(varchar(12), getdate(), 111),1,5)

RIGHT(CONVERT(VARCHAR(10),GETDATE(),120),5)

SELECTRIGHT(CONVERT(varchar(12), getdate(), 111) ,5)

selectstuff(CONVERT(varchar(12), getdate(), 111),1,5,‘‘)

substring(CONVERT(varchar(12), getdate(), 111),6,len(getdate())-5) 

SQL date format output-go

Related Article

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.