SELECT CONVERT(VARCHAR(5), GETDATE(), 108)

RESULT:  13:19

For Time values

DECLARE @TimeField TIME = CAST(GETDATE() AS TIME);

SELECT CONVERT(VARCHAR(5), @TimeField, 108)

RESULT:  13:21
Answer from M.Ali on Stack Overflow
🌐
SQLServerCentral
sqlservercentral.com › forums › topic › adding-hhmmss-time-to-yyyy-mm-dd-hhmmss-format
adding hh:mm:ss time to yyyy-mm-dd hh:mm:ss format – SQLServerCentral Forums
December 10, 2021 - INSERT INTO [portman].[dbo].[AgentHours] ([DOMAIN] ,[LOGIN TIMESTAMP] ,[LOGIN TIME] ,[LOGOUT TIMESTAMP] ) SELECT 'EVQ' --literal ,cast([created_at] as datetime) --yyyy-mm-dd hh:mm:ss format ,cast([event_sec] as time) --hh:mm:ss format ,DATEADD([created_at] + [event_sec]) --yyyy-mm-dd hh:mm:ss format FROM [Portman].[dbo].[ConvoHrs]
Discussions

Timeformat: hhmmss - SQLTeam.com Forums
Hi I need to have the time format in hhmmss SELECT CONVERT(VARCHAR(8),GETDATE(),108) 15:31:42 I need it to be 153142 is there the way to do it? Thanks More on forums.sqlteam.com
🌐 forums.sqlteam.com
0
November 14, 2023
Date Format (mm/dd/yyyy hh:mm), no seconds or milliseconds – SQLServerCentral Forums
Date Format (mm/dd/yyyy hh:mm), no seconds or milliseconds Forum – Learn more on SQLServerCentral More on sqlservercentral.com
🌐 sqlservercentral.com
February 9, 2009
GetUTCDate() In DD-MON-YYYY HH:MM:SS AM/PM
Hi, I am looking to get the date time (GETUTCDATE()) In following 12 hours format: DD-MON-YYYY HH:MM:SS AM/PM Eg: 13-DEC-2018 03:10:58 PM Is there any way of getting this rather than extracting datepart and manipulating them? More on forums.sqlteam.com
🌐 forums.sqlteam.com
0
0
November 1, 2018
Convert varchar value to time in hh:mm:tt in SQL Server
I have a varchar column with time data example " 1700" , "1400" , I need to convert to 17: 00 PM and 02:00 PM or in the format hh:mm:tt More on learn.microsoft.com
🌐 learn.microsoft.com
3
0
May 28, 2023
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › functions › format-transact-sql
FORMAT (Transact-SQL) - SQL Server | Microsoft Learn
Format returns a formatted current time with AM or PM specified. SELECT FORMAT(SYSDATETIME(), N'hh:mm tt'); --> returns 03:46 PM SELECT FORMAT(SYSDATETIME(), N'hh:mm t'); --> returns 03:46 P
🌐
W3Schools
w3schools.com › sql › func_mysql_time_format.asp
MySQL TIME_FORMAT() Function
String Functions: Asc Chr Concat with & CurDir Format InStr InstrRev LCase Left Len LTrim Mid Replace Right RTrim Space Split Str StrComp StrConv StrReverse Trim UCase Numeric Functions: Abs Atn Avg Cos Count Exp Fix Format Int Max Min Randomize Rnd Round Sgn Sqr Sum Val Date Functions: Date DateAdd DateDiff DatePart DateSerial DateValue Day Format Hour Minute Month MonthName Now Second Time TimeSerial TimeValue Weekday WeekdayName Year Other Functions: CurrentUser Environ IsDate IsNull IsNumeric SQL Quick Ref
🌐
SQLTeam
forums.sqlteam.com › t › timeformat-hhmmss › 23669
Timeformat: hhmmss - SQLTeam.com Forums
November 14, 2023 - Hi I need to have the time format in hhmmss SELECT CONVERT(VARCHAR(8),GETDATE(),108) 15:31:42 I need it to be 153142 is there the way to do it? Thanks
🌐
SQL Shack
sqlshack.com › sql-convert-date-functions-and-formats
SQL Convert Date functions and formats
May 21, 2021 - It can be a complicated thing to deal with, at times, for SQL Server developers. Suppose you have a Product table with a column timestamp. It creates a timestamp for each customer order. You might face the following issues with it · You fail to insert data in the Product table because the application tries to insert data in a different date format · Suppose you have data in a table in the format YYYY-MM-DD hh:mm: ss.
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › data-types › time-transact-sql
time (Transact-SQL) - SQL Server | Microsoft Learn
The default string literal format (used for down-level client) will align with the SQL standard form, which is defined as hh:mm:ss[.nnnnnnn]. This format resembles the ISO 8601 definition for TIME excluding fractional seconds.
🌐
DB Vis
dbvis.com › thetable › extracting-time-and-date-in-ms-sql-server-a-comprehensive-guide
Extract Date and Time in MS SQL Server: A Complete Guide
February 7, 2025 - CONVERT approach, this formats the time as hh:mm:ss. ... Use the style parameter with CONVERT. ... 111 yields a format of yyyy/mm/dd. Different style codes produce various formats (e.g., 101 for mm/dd/yyyy, 105 for dd-mm-yyyy).
🌐
MSSQLTips
mssqltips.com › home › sql date format examples using convert function
SQL Date Format Examples using SQL CONVERT Function
September 26, 2025 - Check out the table below for all of the different format options for Dates and Times. The date used for all of these examples is “2022-12-30 00:38:54.840” (December 30, 2022). The format is yyyy-mm-dd hh:mm:ss:nnn.
🌐
SQLServerCentral
sqlservercentral.com › forums › topic › date-format-mmddyyyy-hhmm-no-seconds-or-milliseconds
Date Format (mm/dd/yyyy hh:mm), no seconds or milliseconds – SQLServerCentral Forums
February 9, 2009 - Check again... op asked for mm/dd/yyyy hh:mm. Above code returns yyyy-mm-dd hh:mi 😉 · Assuming you don't mind using the Microsoft version of the Kuwaiti algorithm of the Islamic (Hijri) calendar *and* you're all sensible and use dd/mm/yyyy instead of the bizarre mm/dd/yyyy format...:-D...this works:
🌐
W3Schools
w3schools.com › sql › sql_dates.asp
Date Functions in SQL Server and MySQL
SQL Server has the following date data types: DATE - format YYYY-MM-DD · DATETIME - format: YYYY-MM-DD HH:MI:SS · SMALLDATETIME - format: YYYY-MM-DD HH:MI:SS · TIME - format: HH:MI:SS · TIMESTAMP - format: a unique number · Note: The date ...
🌐
SQLTeam
forums.sqlteam.com › transact-sql
GetUTCDate() In DD-MON-YYYY HH:MM:SS AM/PM - Transact-SQL - SQLTeam.com Forums
November 1, 2018 - Hi, I am looking to get the date time (GETUTCDATE()) In following 12 hours format: DD-MON-YYYY HH:MM:SS AM/PM Eg: 13-DEC-2018 03:10:58 PM Is there any way of getting this rather than extracting datepart and manipulati…
🌐
C# Corner
c-sharpcorner.com › code › 3458 › sql-date-format-in-hhmm-ampm.aspx
SQL Date Format In HH:MM AM/PM
August 9, 2016 - SELECT LTRIM(Right(REPLACE(CONVERT(nvarchar(MAX),CAST(GetDate() as smalldatetime), 109),':00:000', ' '), 8))as[current_time] For HH:MM:SS Am/pm · select CONVERT(VARCHAR(8), getdate(), 108) + ' ' + RIGHT(CONVERT(VARCHAR(30), getdate(), 9), 2) SQL Server · SQL Date Format ·
🌐
MSSQLTips
mssqltips.com › home › format sql server dates with format function
Format SQL Server Dates with FORMAT Function
October 31, 2025 - Can you update your second date sample? SELECT FORMAT (getdate(), ‘dd/MM/yyyy, hh:mm:ss ‘) as date for 2 PM would return 02:00:00.
🌐
PostgreSQL
postgresql.org › docs › current › datatype-datetime.html
PostgreSQL: Documentation: 18: 8.5. Date/Time Types
1 month ago - The offset will be shown as hh (hours only) if it is an integral number of hours, else as hh:mm if it is an integral number of minutes, else as hh:mm:ss. (The third case is not possible with any modern time zone standard, but it can appear when ...
🌐
Database Guide
database.guide › how-to-add-am-pm-to-a-time-value-in-sql-server-t-sql
How to Add AM/PM to a Time Value in SQL Server (T-SQL)
June 11, 2019 - DECLARE @thetime time = '11:28:15' SELECT FORMAT(@thetime, 'hh\:mm tt') 'time', FORMAT(CAST(@thetime AS datetime), 'hh:mm tt') 'datetime';
🌐
YouTube
youtube.com › watch
SQL : How to convert an integer (time) to HH:MM:SS
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
FMS Inc.
fmsinc.com › microsoftaccess › SQLServerUpsizing › AM_PM_date_time_format.htm
Microsoft SQL Server Tip to use AM/PM Non-Military Time Formats in SQL Server
September 6, 2016 - Microsoft SQL Server 2012 introduced the Format function. You can now get the time very easily: SELECT Format(GetDate(), 'hh:mm tt') returns 02:07 PM
🌐
Narkive
microsoft.public.sqlserver.programming.narkive.com › Zh0Iviwd › display-time-only-hh-mm-ss-am-format
Display Time Only (hh:mm:ss AM - format)
There's not much articles out there for time formating. Thank you very much. ... Permalink Gotta Agree with Vyas, if you can you should do this in your client app, but if you really want to do it in SQL take out current_timestamp with your column. SELECT LEFT(RIGHT(CONVERT ( VARCHAR (50), CURRENT_TIMESTAMP, 9), 14), 8) + RIGHT(CONVERT ( VARCHAR (50), CURRENT_TIMESTAMP, 9),2 ) Grant