Reputation: 61
NEED an output like
11/23/15 05:14:05 PM
Upvotes: 0
Views: 75
Reputation: 507
Or you can try this:
SELECT FORMAT(GETDATE(), 'MM/dd/yy hh:mm:ss tt', 'en-US')
You can customize the date time format as you like.
Upvotes: 1
Reputation: 1746
Try this..
SELECT CONVERT(VARCHAR(20), SYSDATETIME(), 22)
there are many available formats on the net.. try some googling.
below are sample link:
http://www.sql-server-helper.com/sql-server-2008/sql-server-2008-date-format.aspx
Upvotes: 2