To format the date and/or time in SQL Server, use the T-SQL FORMAT () function. Simply specify the date and time, as well as the format to be used. The format is provided in the form of a format string. The output should be structured according to the format string.