Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert date to ISO 8601 in SQL-Server? [duplicate]

Tags:

sql

sql-server

I have a column with date format 2006-09-08 14:39:41.000.
I want make a view using this column but I need the date to display in ISO 8601: yyyy-MM-ddThh:mm:ss.SSSZ.
How can I convert it?

like image 685
Kliver Max Avatar asked May 08 '13 06:05

Kliver Max


Video Answer


1 Answers

Conversion code for ISO 8601 is 126, you can use something like this:

SELECT CONVERT(VARCHAR, DateColumn, 126) FROM Table
like image 119
Semih Yagcioglu Avatar answered Sep 30 '22 18:09

Semih Yagcioglu