Monday, July 2, 2012

Different Date Formats with Convertion

SELECT CONVERT(VARCHAR(20),GETDATE(),100) -- Jul  2 2012  6:34PM

SELECT CONVERT(VARCHAR(20),GETDATE(),101) -- 07/02/2012

SELECT CONVERT(VARCHAR(20),GETDATE(),102) -- 2012.07.02

SELECT CONVERT(VARCHAR(20),GETDATE(),103) -- 02/07/2012

SELECT CONVERT(VARCHAR(20),GETDATE(),104) -- 02.07.2012

SELECT CONVERT(VARCHAR(20),GETDATE(),105) -- 02-07-2012

SELECT CONVERT(VARCHAR(20),GETDATE(),106) -- 02 Jul 2012

SELECT CONVERT(VARCHAR(20),GETDATE(),107) -- Jul 02, 2012

SELECT CONVERT(VARCHAR(20),GETDATE(),108) -- 18:34:54

SELECT CONVERT(VARCHAR(20),GETDATE(),109) -- Jul  2 2012  6:34:54

SELECT CONVERT(VARCHAR(20),GETDATE(),110) -- 07-02-2012

SELECT CONVERT(VARCHAR(20),GETDATE(),111) -- 2012/07/02

SELECT CONVERT(VARCHAR(20),GETDATE(),112) -- 20120702

SELECT CONVERT(VARCHAR(20),GETDATE(),113) -- 02 Jul 2012 18:34:54

SELECT CONVERT(VARCHAR(20),GETDATE(),114) -- 18:34:54:707

SELECT CONVERT(VARCHAR(20),GETDATE(),120) -- 2012-07-10 06:45:14

SELECT CONVERT(VARCHAR(20),GETDATE(),121) -- 2012-07-10 06:45:14.

SELECT CONVERT(VARCHAR(20),GETDATE(),126) -- 2012-07-10T06:45:14.

SELECT CONVERT(VARCHAR(20),GETDATE(),127) -- 2012-07-10T06:45:14.

SELECT CONVERT(VARCHAR(20),GETDATE(),130) -- 21 ????? 1433  6:45:

SELECT CONVERT(VARCHAR(20),GETDATE(),131) -- 21/08/1433  6:45:14:



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.