Last active
November 9, 2017 16:50
-
-
Save mikaelweave/74eb10e16273078fa22d to your computer and use it in GitHub Desktop.
Convert SQL DATETIME to superior human DATETIME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
FORMAT(GETDATE(), 'g'), | |
CONVERT(VARCHAR(32), CAST(GETDATE() AS DATE), 101) AS d, | |
REPLACE(REPLACE(RIGHT(CAST(GETDATE() AS DATETIME), 7), 'AM', ' AM'), 'PM', ' PM') AS t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment