CONVERT(varchar, getdate(), 1(2,3,4,5,6)) : Date Format « Date Timezone « SQL Server / T-SQL






CONVERT(varchar, getdate(), 1(2,3,4,5,6))


1> SELECT
2>    CONVERT(varchar, getdate(), 1),
3>    CONVERT(varchar, getdate(), 2),
4>    CONVERT(varchar, getdate(), 3),
5>    CONVERT(varchar, getdate(), 4),
6>    CONVERT(varchar, getdate(), 5),
7>    CONVERT(varchar, getdate(), 6)
8> GO


------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ -------------------------
-----
10/12/06                       06.10.12                       12/10/06                       12.10.06                       12-10-06                       12 Oct 06


(1 rows affected)
1>
           
       








Related examples in the same category

1.CONVERT(varchar,GETDATE(),108) 'hh:mm:ss'
2.CONVERT(varchar,GETDATE(),114) 'hh:mm:ss:mmm'
3.CONVERT(varchar,GETDATE(),113) 'dd Mmm yyyy hh:mm:ss:mmm'
4.CONVERT(VarChar(50), GETDATE(), 104)
5.CONVERT(VarChar(50), GETDATE(), 103)
6.CONVERT(VarChar(50), GETDATE(), 100)
7.CONVERT(VarChar(50), GETDATE(), 101)
8.CONVERT(VarChar(50), GETDATE(), 102)
9.Reference Date data type as string (char)
10.Format date: 'Mmm dd yyyy hh:mmdp'
11.Format date: 'mm/dd/yyyy'