Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Dec 20, 1999

Converting GETDATE to 24-Hour Format

Question:
Using GETDATE returns the time portion of the date in the 12-hour clock form ("08:30pm"). I need the time portion to be in 24-hour clock form ("20:30"). I can't figure out how to convert to a 24-hour clock format. Any suggestions?

Answer:
Sure, try this:

 
select convert(character(14),getdate(),114)
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date