Skip to content

Instantly share code, notes, and snippets.

@icalderond
Created January 26, 2015 16:56
Show Gist options
  • Save icalderond/e7231d982033f3d64492 to your computer and use it in GitHub Desktop.
Save icalderond/e7231d982033f3d64492 to your computer and use it in GitHub Desktop.
Ver formatos de fecha en SQL Server
declare @dob2 DATETIME=getdate()
select convert(varchar, @dob2, 101)--01/26/2015
select convert(varchar, @dob2, 102)--2015.01.26
select convert(varchar, @dob2, 103)--26/01/2015
select convert(varchar, @dob2, 104)--26.01.2015
select convert(varchar, @dob2, 105)--26-01-2015
select convert(varchar, @dob2, 106)--26 Jan 2015
select convert(varchar, @dob2, 107)--Jan 26, 2015
select convert(varchar, @dob2, 108)--10:52:40
select convert(varchar, @dob2, 109)--Jan 26 2015 10:52:40:380AM
select convert(varchar, @dob2, 110)--01-26-2015
select convert(varchar, @dob2, 111)--2015/01/26
select convert(varchar, @dob2, 112)--20150126
select convert(varchar, @dob2, 113)--26 Jan 2015 10:52:40:380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment