SQL Server Time Formats

Hello to everyone,

In this article, I will talk about time format changing operations in SQL Server.

Time format change is often used in SQL Server.

You can use the codes below to change the time format.

8
SELECT CONVERT(VARCHAR, GETDATE(), 8);
hh:mm:ss 00:38:54
14
SELECT CONVERT(VARCHAR, GETDATE(), 14);
hh:mm:ss:nnn 00:38:54:840
24
SELECT CONVERT(VARCHAR, GETDATE(), 24);
hh:mm:ss 00:38:54
108
SELECT CONVERT(VARCHAR, GETDATE(), 108);
hh:mm:ss 00:38:54
114
SELECT CONVERT(VARCHAR, GETDATE(), 114);
hh:mm:ss:nnn 00:38:54:840

When you run the code, you will get a result like the one below.

SQL Server Time Formats

As you can see, the time values have been changed in a formatted way.

Good luck to everyone in business and life

293 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!