Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Convert EST time 12 hours format

Author  Topic 

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2012-09-10 : 03:04:09
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

212 Posts

Posted - 2012-09-11 : 02:16:05
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

52326 Posts

Posted - 2012-09-11 : 11:25:24
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
   

- Advertisement -