Stop searching the web for date formats, query the database
Michael M.
Simple query to show you all the date time formats in the database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
DECLARE @counter INT = 0 DECLARE @date DATETIME = '2006-12-30 00:38:54.840' CREATE TABLE #dateFormats (dateFormatOption int, dateOutput nvarchar(40)) WHILE (@counter <= 150 ) BEGIN BEGIN TRY INSERT INTO #dateFormats SELECT CONVERT(nvarchar, @counter), CONVERT(nvarchar,@date, @counter) SET @counter = @counter + 1 END TRY BEGIN CATCH; SET @counter = @counter + 1 IF @counter >= 150 BEGIN BREAK END END CATCH END SELECT * FROM #dateFormats; |
Leave a Reply