Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Thumbs up Unanswered: extract hour from a adte

    hi,



    how to extract hour part from a date?

    suppose my date is like

    29-mar-2004 09:20:34

    i wanna get only hour fromthe above date-

    thanx.

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: extract hour from a adte

    Originally posted by neema
    hi,



    how to extract hour part from a date?

    suppose my date is like

    29-mar-2004 09:20:34

    i wanna get only hour fromthe above date-

    thanx.
    Assume that your date information is variable mydate (which is date datatype).

    to_char(mydate, 'HH24')

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    Hi,
    This is help you
    1* select to_char(to_date('29-mar-2004 09:20:34','dd-mon-yyyy hh:mi:ss'),'hh') from dual
    SQL> /

    TO
    --
    09


    Thanks,
    Pagnint
    (No need to search web before posting new question)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •