How can we gets date in different formats
Here are examles:
SELECT CONVERT(CHAR(8),GETDATE(),101) -- 07/10/20
SELECT CONVERT(CHAR(20),GETDATE(),100) -- Jul 10 2007 12:23PM
SELECT CONVERT(CHAR(15),GETDATE(),102) -- 2007.07.10
SELECT CONVERT(CHAR(15),GETDATE(),103) -- 10/07/2007
SELECT CONVERT(CHAR(15),GETDATE(),104) -- 10.07.2007
SELECT CONVERT(CHAR(15),GETDATE(),105) -- 10-07-2007
SELECT CONVERT(CHAR(15),GETDATE(),106) -- 10 Jul 2007
SELECT CONVERT(CHAR(15),GETDATE(),107) -- Jul 10, 2007
SELECT CONVERT(CHAR(10),GETDATE(),108) -- 12:17:50
SELECT CONVERT(CHAR(20),GETDATE(),109) -- Jul 10 2007 12:21:27
SELECT CONVERT(CHAR(15),GETDATE(),110) -- 07-10-20
SELECT CONVERT(CHAR(15),GETDATE(),111) -- 2007/07/10
SELECT CONVERT(CHAR(15),GETDATE(),112) -- 20070710
SELECT CONVERT(CHAR(20),GETDATE(),113) -- 10 Jul 2007 12:20:36
Hope this helps..
No comments:
Post a Comment