Transact-SQL really lack a the neccessary support for creating and modifying dates and times. Now and then I have the need for creating custom dates based on year, month and day. This is not an easy task. To simplify the manipulation of dates and times a small toolkit of userdefined functions has been developed:
Date and Time functions
Calendar functions
Date and Time functions
- Create a date from year, month and day
- Create a DateTime value from year, month, day, hours, minutes and seconds
- Create a time structure for a given date
- Extract the date portion of a DateTime value
- Extract the time portion of a DateTime value
Calendar functions