Reputation: 227
How do you convert a string like 2015-10-08 19:56:30.0
to a datetime
in SQL Server without having to change languages?
Upvotes: 3
Views: 1161
Reputation: 174
I think this may help you, I have tried this.
Declare @Time as nvarchar(25)
Set @Time = '2015-10-08 19:56:30.0'
Select Cast(@Time As DateTime);
Upvotes: 1