MS SQL Server Chinese version of the preset date datetime format is YYYY-MM-DD hh:mm:ss.mmm
Long and Short date format
Copy CodeThe code is as follows:
--Short Date format: yyyy-m-d
SELECT REPLACE (CONVERT (varchar), GETDATE (), (), N '-0 ', '-')
--Long date format: YYYY year mm month DD Day
SELECT STUFF (STUFF (CONVERT (char (8), GETDATE (), 112), 5,0,n ' year '), 8,0,n ' month ') +n ' Day '
--Short date format: YYYY year M month D-Day
SELECT Datename (Year,getdate ()) +n ' year ' +cast (DATEPART (Month,getdate ()) as varchar) +n ' month ' +datename (Day,getdate ()) +n ' Day '
--Full Date + time format: Yyyy-mm-dd hh:mi:ss:mmm
SELECT CONVERT (char (one), GETDATE (), +convert) (char (), GETDATE (), 114)
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.