Monday, December 11, 2017

How to convert 24 hour formatted time into 12 hour formatted time in SQL server ?

How to convert 24 hour formatted time into 12 hour formatted time in SQL server ?


DECLARE @TIME TIME
SET @TIME = '17:45:00'
SELECT CONVERT(VARCHAR(15),@TIME,100)

Result : 5:45PM

No comments:

Post a Comment