Re: date format mask?
From: David Fitzjarrell <oratune_at_yahoo.com>
Date: Thu, 9 Jun 2011 20:01:31 -0700 (PDT)
Message-ID: <15126.33215.qm_at_web65413.mail.ac4.yahoo.com>
Date: Thu, 9 Jun 2011 20:01:31 -0700 (PDT)
Message-ID: <15126.33215.qm_at_web65413.mail.ac4.yahoo.com>
I probably knew that in my youth. :D Thank you for the excellent example.
David Fitzjarrell
________________________________
From: Wolfgang Breitling <breitliw_at_centrexcc.com>
To: oratune_at_yahoo.com
Cc: gus.spier_at_gmail.com; eugene.pipko_at_unionbay.com; "oracle-l_at_freelists.org"
<oracle-l_at_freelists.org>
Sent: Thu, June 9, 2011 6:24:52 PM
Subject: Re: date format mask?
Why so complicated?
SQL> select to_date('2011-05-24T23:21:30.000Z','yyyy-mm-dd"T"hh24:mi:ss".000Z"')
from dual;
TO_DATE('2011-05-24
-------------------
2011-05-24 23:21:30
1 row selected.
You can have any number and kind of additional characters in the dat mask. You
just need to enclose them in "
On 2011-06-09, at 6:33 PM, David Fitzjarrell wrote:
SQL> begin
> 2 :l_amazon_date := substr(translate('2011-05-24T23:21:30.000Z', 'TZ','
>'),1, instr(translate('2011-05-24T23:21:30.000Z', 'TZ',' '),'.') - 1);
> 3 end;
> 4 /
>PL/SQL procedure successfully completed.
>SQL>
>SQL> select TO_DATE(:l_amazon_date, 'YYYY-MM-DD HH24:MI:SS')
> 2 from dual;
>
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Jun 09 2011 - 22:01:31 CDT
