Common date functions
SQL Server time and date function detailed, SQL Server, time, date,
1. Current system date, time
Select GETDATE ()
2. DateAdd returns a new datetime value on the basis of adding a period of time to the specified date
For
SQL Server Date and Time Processing set
When the convert date conversion format is 20 or 120, the resulting string does not contain milliseconds.For example, select convert (varchar (23), getdate (), 120 or 20)21:46:43
When the date conversion
Convert a date format using the CONVERT function in SQL Server2008-01-23 15:47
Convert date format with convert function in SQL Server 2008-01-15 convert date format with convert function in 15:51sqlserverThe default date field for the
Convert a date format using the CONVERT function in SQL Server2008-01-23 15:47Convert date format with convert function in SQL Server 2008-01-15 convert date format with convert function in 15:51sqlserverThe default date field for the Chinese
Convert date format with convert function in SQL Server 2008-01-15 convert date format with convert function in 15:51sqlserverThe default date field for the Chinese version of SQL Server datetime format is YYYY-MM-DD Thh:mm:ss.mmmFor example:Select
In sqlserver2000, convert is used to obtain the processing result of the datetime data type style (full) date data format. Two examples are as follows: CONVERT (varchar (16), time 1, 20: 2007-02-0108:02 * The time is generally the * CONVERT (varchar
Convert date format with convert function in SQL Server 2008-01-15 convert date format with convert function in 15:51sqlserverThe default date field for the Chinese version of SQL Server datetime format is YYYY-MM-DD Thh:mm:ss.mmmFor example:Select
ConvertExplicitly converts a data type expression to another data type. Because some requirements often use different date formats, the following can be found inFormat the date in SQL Server.
SQL Server supports the data format in the Arabic style
Use convert in SQL server2000 to obtain the datetime data type style (full)
Processing of date data format:
CONVERT (varchar (16), time 1, 20) Result:/* The time is generally the getdate () function or the field in the data table */
Result of
? In sqlserver, convert is used to obtain the processing of datetime data format (full). Two examples are as follows: CONVERT (varchar (16), time 1, 20) Result: 2007-02-0108:02 * The time is generally the * CONVERT (varchar (10), time 1, 23) Result
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.