I'm having a table IMAGEDATA
in which the column VALUE stores datetime format in en-US
(for ex. 06/08/2012 02:10:36 p.m
.). I need to convert the datetime
format to ISO8601
format (ex. 2012-08-22T13:10:39
) for all the rows that are currently in the table. I'm novice in these topics. Could you please me some better approach it will be more helpful.Thanks.
Asked
Active
Viewed 731 times
0
-
Check this http://stackoverflow.com/questions/16434481/how-to-convert-date-to-iso-8601-in-sql-server/16434596#16434596 – UdayKiran Pulipati May 16 '13 at 09:06
1 Answers
1
Internally Datetime values are stored as 2 integers
. They are not stored in the specific format in which they are inserted .In order to convert to 8601
format try the below code
Declare @date datetime
set @date = '06/08/2012 02:10:36 '
Select convert(varchar(30),@date,126)

praveen
- 12,083
- 1
- 41
- 49