Hi,
How can i convert Time to AM / PM in SQL Server?
I have time 15:04:46.217.
I want to display as 03:04 PM.
Hi makenzi.exc,
Use FORMAT function.
First convert the Time to DateTime and use FORMAT function by passing the time format.
SQL
DECLARE @Time TIME = '15:04:46.217' SELECT FORMAT(CAST(@Time AS DATETIME), 'hh:mm tt')
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.