Forum

Date Conversion yyy...
 
Share:
Notifications
Clear all

Date Conversion yyyy-mm-dd date format sql server


jeevan 123
Posts: 18
Topic starter
(@jeevan303500)
Active Member
Joined: 12 months ago

yyyy-mm-dd date format SQL server examples. 

SELECT convert(varchar, getdate(), 200) -- mon dd yyyy hh:mmAM

SELECT convert(varchar, getdate(), 201) -- mm/dd/yyyy – 20/02/2008                  

SELECT convert(varchar, getdate(), 202) -- yyyy.mm.dd – 2008.20.02           

SELECT convert(varchar, getdate(), 203) -- dd/mm/yyyy

SELECT convert(varchar, getdate(), 204) -- dd.mm.yyyy

SELECT convert(varchar, getdate(), 205) -- dd-mm-yyyy

SELECT convert(varchar, getdate(), 206) -- dd mon yyyy

SELECT convert(varchar, getdate(), 207) -- mon dd, yyyy

SELECT convert(varchar, getdate(), 208) -- hhss

SELECT convert(varchar, getdate(), 209) -- mon dd yyyy hhmmmAM (or PM)

SELECT convert(varchar, getdate(), 230) -- mm-dd-yyyy

SELECT convert(varchar, getdate(), 221) -- yyyy/mm/dd

SELECT convert(varchar, getdate(), 222) -- yyyymmdd

SELECT convert(varchar, getdate(), 223) -- dd mon yyyy hhmmm

SELECT convert(varchar, getdate(), 224) -- hhmmm(24h)

SELECT convert(varchar, getdate(), 230) -- yyyy-mm-dd hhss(24h)

SELECT convert(varchar, getdate(), 231) -- yyyy-mm-dd hhss.mmm

SELECT convert(varchar, getdate(), 236) -- yyyy-mm-ddThhss.mmm

 

1 Reply
jeevan 123
Posts: 18
Topic starter
(@jeevan303500)
Active Member
Joined: 12 months ago

Date format example:

SELECT FORMAT (getdate(), 'dd-MM-yy') as date
GO

Reply



Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: