getdate() function
This question already has an answer here:
Use convert. The first argument truncates the length, and the last specifies the format you want the date in:
SELECT Convert(varchar(10), getdate(), 103) as [Today's Date]
If you are using SQL Server 2012+, you may also want to look at FORMAT
- which in my opinion is a bit nicer to read/use.
Example: SELECT FORMAT(GETDATE(), 'dd/MM/yyyy')
See this msdn link for more info
链接地址: http://www.djcxy.com/p/94378.html下一篇: getdate()函数