How to convert a DateTime string to a DateTime in SQL Server
问题 I have a DateTime varchar in this format: 2005-08-08T00:00:00+01:00. Does this format have a name? (it's not ISO8601. Is it RFC3339?) How can I convert it to a DateTime using Transact-Sql? EDIT Here's a summary answer, cobbled together from others input: It is ISO8601 with a time offset from UTC. If it was UTC it would end with a 'Z' instead of '+01:00'. wikipedia You can convert it to local time or to utc as follows: DECLARE @d VARCHAR(25) SET @d = '2007-08-08T00:01:00+01:00' SET @d = '2007