Solved

SQL Convert Date

Posted on 2013-06-10
2
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 39234463
0
 
LVL 25

Accepted Solution

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
point in time restore in SQL server 26 46
SQL Syntax 6 32
T-SQL: Please describe what a page split is 5 35
How to trim a value in SQL 2 27
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

726 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