[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

SQL Convert Date

Hi Guys

SQL Server 2008.

I need to convert 'Tue Jun 18 10:00:00 UTC+0100 2013' to '2013-06-18 10:00:00.000'.

Any ideas

Thanks,
Shezad
0
Shezad Ahmed
Asked:
Shezad Ahmed
1 Solution
 
plusone3055Commented:
0
 
Lee SavidgeCommented:
Messy but it works:

select convert(nvarchar(23), cast(substring(replace('Tue Jun 18 10:00:00 UTC+0100 2013', 'UTC+0100 ', ''), 4, 1000) as datetime), 121)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now