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
 Date time format

Author  Topic 

luarit
Starting Member

6 Posts

Posted - 2012-01-10 : 04:28:26
Hello,

I would like to do a select to get the current date&time in this format:

2011-10-04T04:20:35.2313103+01:00

do you know how can I do that?

Thx

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2012-01-10 : 04:47:20
quote:
Originally posted by luarit

Hello,

I would like to do a select to get the current date&time in this format:

2011-10-04T04:20:35.2313103+01:00

do you know how can I do that?

Thx



If T and +01:00 is Static

SELECT replace(CONVERT(VARCHAR(30), GETDATE(), 120),' ','T' )+' +01:00'

--Ranjit
Go to Top of Page

luarit
Starting Member

6 Posts

Posted - 2012-01-10 : 04:55:30
Could you give me the steps that I have to follow. I want to run a select in TOAD and get dat&time as:

select sysdate
from dual

which select Do I have to run? And if T is not static?

Regards
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-01-10 : 09:38:12
quote:
Originally posted by luarit

Could you give me the steps that I have to follow. I want to run a select in TOAD and get dat&time as:

select sysdate
from dual

which select Do I have to run? And if T is not static?

Regards


This is SQL Server forum. Post your question at Oracle forums like www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -