Re: How to convert "Thu Nov 17 06:44:23 CST 2005" to date ?

From: <admin_at_rbtron.com>
Date: Tue, 10 Mar 2009 15:02:47 -0700 (PDT)
Message-ID: <24d9b674-7d0f-411d-a8e5-10f9247aa877_at_y13g2000yqn.googlegroups.com>



On Mar 10, 4:36 pm, Maxim Demenko <mdeme..._at_gmail.com> wrote:
> ad..._at_rbtron.com schrieb:
>
> > Hi,
>
> > How to convert "Thu Nov 17 06:44:23 CST 2005" to date ?
>
> > This works :
>
> > select to_date('Thu Nov 17 06:44:23 2005','Dy Mon DD hh24:mi:ss yyyy')
> > from dual;
>
> > But when timezone is added in between, it doesn't.
>
> > Thanx
>
> > -Adm
>
> Datatype date has no idea about timezone ;-)
> If you need this information to be accounted by the date value, you have
>   (before cast) to utiliize from_tz
>
> SQL> select cast(to_timestamp_tz('Thu Nov 17 06:44:23 CST 2005','Dy Mon
> DD hh24:mi:ss TZD yyyy') as date)
>    2  from dual
>    3  ;
>
> CAST(TO_TIMESTAMP_T
> -------------------
> 17.11.2005 06:44:23
>
> Best regards
>
> Maxim

Just awesome, as usual ... Received on Tue Mar 10 2009 - 17:02:47 CDT

Original text of this message