Skip to content

Instantly share code, notes, and snippets.

@rtipton
Created March 20, 2010 03:13
Show Gist options
  • Save rtipton/338450 to your computer and use it in GitHub Desktop.
Save rtipton/338450 to your computer and use it in GitHub Desktop.
SQL -- Converting Dates
SELECT
GETDATE() AS DefaultFormat,
CONVERT(nvarchar(30), GETDATE(), 101) AS US,
CONVERT(nvarchar(30), GETDATE(), 103) AS UK,
CONVERT(nvarchar(30), GETDATE(), 111) AS Japan,
CONVERT(nvarchar(30), GETDATE(), 104) AS German,
CONVERT(nvarchar(30), GETDATE(), 112) AS ISO,
CONVERT(nvarchar(30), GETDATE(), 109) AS Date_with_Milliseconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment