Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ISO 8601 standrad for date time

Author  Topic 

ravisankarnbr
Starting Member

3 Posts

Posted - 2010-02-10 : 07:10:21

Hi

I have a question of getting recorded time stamps using UTC based on ISO 8601 in Sql server 2005.

Example: "1994-11-05T08:15:30-05:00".

Format : YYYY-MM-DDThh:mm:ss.sTZD

if i want to achieve this, is there a need to specify each element in the format







harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2010-02-10 : 07:35:44
You can use style as 126 with CONVERT function:

Convert(varchar(30), @date, 126)


Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page

ravisankarnbr
Starting Member

3 Posts

Posted - 2010-02-10 : 07:51:11
Hi Harsh,
Thanks for ur reply.

how can i get the time zone difference in sql server.

The Last part of ISO 8601 format is Timezone diff EX: -05:00
Go to Top of Page
   

- Advertisement -