SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Convert EST time 12 hours format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

itnagaraj
Yak Posting Veteran

India
69 Posts

Posted - 09/10/2012 :  03:04:09  Show Profile  Reply with Quote
Date time is '2012-09-07 23:48:41.000'

How to convert 12 hoiurs format in sql server?


V.NAGARAJAN

prett
Posting Yak Master

USA
203 Posts

Posted - 09/11/2012 :  02:16:05  Show Profile  Visit prett's Homepage  Reply with Quote
See following example
DateTime d = DateTime.Now;

// 12 hour format
Response.Write(d.ToString("hh:mm") + " | " );
// 24 hour format
Response.Write(d.ToString("H:mm"));


Hope this will help!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 09/11/2012 :  11:25:24  Show Profile  Reply with Quote
quote:
Originally posted by itnagaraj

Date time is '2012-09-07 23:48:41.000'

How to convert 12 hoiurs format in sql server?


V.NAGARAJAN



SELECT CONVERT(varchar(25),datevalue,100)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000