--getdate Current system date, timeSelect getdate()--2014-11-24 13:22:40.407--the CONVERT () function can display date/time data in different formatsSelect Convert(varchar( -),getdate(), at)--2014-11-24--DateDiff Returns the number of date and time boundaries across two specified datesSelect DateDiff( Day,'2014-11-24','2014-12-28')-- theSelect DateDiff(Month,'2014-11-24','2014-12-28')--1--datepart Returns an integer representing the specified date part of a specified dateSelect DatePart(Month,'2014-11-24')--NovemberSelect DatePart(Week,'2014-11-24')--48 weeksSelect DatePart(W,'2014-11-24')--2 Monday--Datename Returns a string representing the specified date part of a specified dateSelect Datename(Month,'2014-11-24')-- OneSelect Datename(Weekday,'2014-11-24')--Monday--DateAdd () function adds or subtracts a specified time interval DATEADD (datepart,number,date) in a dateSelect DateAdd( Day,2,'2014-11-24')--2014-11-26 00:00:00.000Select DateAdd(Month,-2,'2014-11-24')--2014-09-24 00:00:00.000
SQL-----Datediff,dateadd,datedepart,datename,convert