George
George

Reputation: 61

date , time date format

NEED an output like

11/23/15 05:14:05 PM

Upvotes: 0

Views: 75

Answers (2)

Harlo
Harlo

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

japzdivino
japzdivino

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

Related Questions