Re: date format mask?

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Thu, 9 Jun 2011 19:24:52 -0600
Message-Id: <2C6A03BF-78E5-4282-A9F2-9710BD7AFCC6_at_centrexcc.com>



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-l
Received on Thu Jun 09 2011 - 20:24:52 CDT

Original text of this message