Converting datetime format to 12 hour

If you want to convert the current datetime for example:

SELECT CONVERT(VARCHAR, getdate(), 100) AS DateTime_In_12h_Format

Instead of getdate() you can put your desired column in a query (such as tdate in your example). If you want JUST the time in 12h and not the date and time use substring/right to separate them. It seems that you already know how to =).

This page lists every datetime conversion. It's really handy if you need other types of conversions.


This will return just the time, not the date.

SELECT RIGHT(CONVERT(VARCHAR, getdate(), 100), 7) AS time

For your table data:

select RIGHT(CONVERT(varchar, tdate ,100), 7) AS [Time] from table