If your tool can convert from time to string, convert it to the format you included. The [.nnnn] is for nanoseconds. I have not seen an application requiring this level of accuracy. If you're okay with second-level accuracy, datetimeoffset(0) enough.
Example:
DECLARE @time_str varchar(30) = '2015-01-19 7:20:00 -08:00' DECLARE @time datetimeoffset(0) = CONVERT(datetimeoffset, @time_str) SELECT DATEPART(YEAR, @time), DATEPART(MONTH, @time), DATEPART(DAY, @time), DATEPART(HOUR, @time), DATEPART(MINUTE, @time), DATEPART(SECOND, @time), DATEPART(TZOFFSET, @time)
user2966581
source share