Converting Dates in SQL Server


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT
  2. GETDATE() AS DefaultFormat,
  3. CONVERT(nvarchar(30), GETDATE(), 101) AS US,
  4. CONVERT(nvarchar(30), GETDATE(), 103) AS UK,
  5. CONVERT(nvarchar(30), GETDATE(), 111) AS Japan,
  6. CONVERT(nvarchar(30), GETDATE(), 104) AS German,
  7. CONVERT(nvarchar(30), GETDATE(), 112) AS ISO,
  8. CONVERT(nvarchar(30), GETDATE(), 109) AS Date_with_Milliseconds

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.