RE: date format mask?

From: Eugene Pipko <eugene.pipko_at_unionbay.com>
Date: Fri, 10 Jun 2011 08:30:39 -0700
Message-ID: <34DB87F47199374280ADFD2968CDBCFA8888E929A2_at_MAIL01KT.seattlepacificindustries.com>



Thanks a lot for your responses and the solution. Learned something new.

From: Wolfgang Breitling [mailto:breitliw_at_centrexcc.com] Sent: Thursday, June 09, 2011 6:25 PM
To: oratune_at_yahoo.com
Cc: gus.spier_at_gmail.com; Eugene Pipko; oracle-l_at_freelists.org 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-l Received on Fri Jun 10 2011 - 10:30:39 CDT

Original text of this message