Date and Time Functions Supported by SQL Server 2005 in SQL Server

Q

What Are the Date and Time Functions Supported by SQL Server 2005 in SQL Server Transact-SQL?

✍: FYIcenter.com

A

SQL Server 2005 supports n character string functions:

  • DATEADD(datepart, number, date) - Returning the same date and time value with one part added with the "number".
  • DATEDIFF(datepart, startdate, enddate) - Returning an integer representing the difference of the specified part between two date and time values.
  • DATENAME(datepart, date) - Returning the name string of the specified part of the input date.
  • DATEPART(datepart, date) - Returning an integer representing the specified part of the input date.
  • DAY(date) - Returning an integer representing the day part of the input date.
  • GETDATE() - Returning a date and time value representing the current date and time.
  • GETUTCDATE() - Returning a date and time value representing the current date and time in UTC (Coordinated Universal Time or Greenwich Mean Time).
  • MONTH(date) - Returning an integer representing the month part of the input date.
  • YEAR(date) - Returning an integer representing the year part of the input date.

 

Date/Time Operations and Functions in SQL Server Transact-SQL

⇒⇒SQL Server Transact-SQL Tutorials

2017-02-20, 211👍, 0💬