Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
Created September 5, 2016 17:29
Show Gist options
  • Select an option

  • Save igotit-anything/4872e4a9f5c99c743f09fd2fd174241a to your computer and use it in GitHub Desktop.

Select an option

Save igotit-anything/4872e4a9f5c99c743f09fd2fd174241a to your computer and use it in GitHub Desktop.
MS SQL. RFC822 date format from SQL
// hope result : Thu, 10 May 2007 02:57:50 GMT
SELECT left( datename( dw, getutcdate() ), 3 ) + ', ' +
       convert( varchar(20), getutcdate(), 113 ) + ' GMT'
-----------------------------
Thu, 10 May 2007 05:05:51 GMT
// from https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4a45de7c-c268-4c05-8a38-eff89c0a6d7c/how-to-format-an-rfc822-date-for-rss?forum=sqldatabaseengine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment