sql - Using toChar to output a date in W3C XML Schema xs:dateTime type format -
i'm trying convert sysdate using tochar following format: 2006-11-20t17:10:02+01:00
from format: 16/08/2012 13:40:59
is there standard way of doing this?
i've tried using tochar specific t part string doesn't appear working.
thanks in advance
jezzipin
edit:
i've tried nicholas' solution mention above, need use sysdate. i've used following select query:
select to_char(to_timestamp_tz(sysdate-365, 'dd/mm/yyyy hh24:mi:ss'),'yyyy-mm-dd"t"hh24:mi:ss tzh:tzm') dual; however, returns:
0012-08-16t00:00:00 +01:00 which incorrect should 2012-08-16t00:00:00 +01:00
try:
select to_char(sysdate, 'yyyy-mm-dd') || 't' || to_char(sysdate,'hh24:mi:ss') || sessiontimezone dual; returns:
2013-08-16t13:00:51+00:00
Comments
Post a Comment