Displays date but not time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nabh4u
    New Member
    • Jan 2007
    • 62

    Displays date but not time

    Hi all,

    I have problem in displaying time. it only displays date but not time.
    i am using
    DECODE(PROC_TM, '999999', NULL,PROC_TM) proc_tm
    and then
    PROC_TME = TO_DATE(C2.PROC _TM, 'HH24MISS')

    It only displays date but not the time. what should i do?

    And in another procedure i have time displayed but not properly
    like 10:40 is displayed as 1040 (10 min and 40 seconds).
    what should i do in this?

    any advice will be accepted.
    thank you all,

    nabh4u
  • Dave44
    New Member
    • Feb 2007
    • 153

    #2
    Originally posted by nabh4u
    Hi all,

    I have problem in displaying time. it only displays date but not time.
    i am using
    DECODE(PROC_TM, '999999', NULL,PROC_TM) proc_tm
    and then
    PROC_TME = TO_DATE(C2.PROC _TM, 'HH24MISS')

    It only displays date but not the time. what should i do?

    And in another procedure i have time displayed but not properly
    like 10:40 is displayed as 1040 (10 min and 40 seconds).
    what should i do in this?

    any advice will be accepted.
    thank you all,

    nabh4u
    If you are displaying a date you need to format it with to_char not to_date, the latter is used for turning a string to an oracle date.

    Comment

    • holdingbe
      New Member
      • Jul 2007
      • 78

      #3
      Originally posted by Dave44
      If you are displaying a date you need to format it with to_char not to_date, the latter is used for turning a string to an oracle date.

      HI friend,

      select to_char(sysdate ,'HH24:MISS')
      from dual


      please do like that

      Regards
      Mihael

      Comment

      • nabh4u
        New Member
        • Jan 2007
        • 62

        #4
        Originally posted by Dave44
        If you are displaying a date you need to format it with to_char not to_date, the latter is used for turning a string to an oracle date.
        I am afraid but the solution you provided to my problem doesnt work. it still displays the same date format but no time is displayed.
        what should i do now?

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          please try the sample code

          [CODE=oracle]select to_char(sysdate ,'HH24:MI:SS') from dual[/CODE]
          hope that solves your problem.

          Comment

          • nabh4u
            New Member
            • Jan 2007
            • 62

            #6
            Originally posted by debasisdas
            please try the sample code

            [CODE=oracle]select to_char(sysdate ,'HH24:MI:SS') from dual[/CODE]
            hope that solves your problem.

            No..even that doesnt work.

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              How is that possible ?

              Can you kindly post your code for my reference please.

              Comment

              • nabh4u
                New Member
                • Jan 2007
                • 62

                #8
                Originally posted by debasisdas
                How is that possible ?

                Can you kindly post your code for myb reference please.
                I am sorry i cant provide the code because of company rules. I tried to provide as much information as possible.
                i am really very sorry. but thanks for helping me.

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Ok ,i can understand the problem.

                  Better you follow some good books / materials .

                  wishing you best of luck.

                  Comment

                  • nabh4u
                    New Member
                    • Jan 2007
                    • 62

                    #10
                    Originally posted by debasisdas
                    Ok ,i can understand the problem.

                    Better you follow some good books / materials .

                    wishing you best of luck.
                    thank you very much for all the support.

                    Comment

                    Working...