Solved

SQL Convert Date

Posted on 2013-06-10
2
254 Views
Last Modified: 2013-06-12
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
Comment
Question by:Shezad Ahmed
2 Comments
 
LVL 22

Expert Comment

by:plusone3055
Comment Utility
0
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now