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
 General SQL Server Forums
 New to SQL Server Programming
 How to convert time

Author  Topic 

sql2020
Yak Posting Veteran

54 Posts

Posted - 2010-11-19 : 07:20:37
How to convert time from Current time to this format like

"Tue Sep 28 08:02:10 EDT 2010"

sql2020

karthik_padbanaban
Constraint Violating Yak Guru

263 Posts

Posted - 2010-11-19 : 09:21:02
[code]
declare @a datetime

select @a='2010-10-28 08:02:10.567'

select left(datename(dw,@a),3)+' ' +left(datename(month,@a),3)+' '+datename(day,@a)+' '+CONVERT(VARCHAR, GETDATE(), 108)+' EDT '+cast(year(@a) as varchar(4))

[/code]

replace your column in the place of @a

Karthik
http://karthik4identity.blogspot.com/
Go to Top of Page

sql2020
Yak Posting Veteran

54 Posts

Posted - 2010-11-22 : 06:43:20
Thank you

sql2020
Go to Top of Page
   

- Advertisement -