removing time from date format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mj36
    New Member
    • Feb 2007
    • 2

    removing time from date format

    hi,

    i m facing a problem in getting the data from the database. actually i m setting a variable with the function getdate. but after setting it i just need the date part of it, not the time part. can anyone tell me how can i remove the time part from the variable. i m using the oracle database and java as front hand.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by mj36
    hi,

    i m facing a problem in getting the data from the database. actually i m setting a variable with the function getdate. but after setting it i just need the date part of it, not the time part. can anyone tell me how can i remove the time part from the variable. i m using the oracle database and java as front hand.
    This sounds more like a Java question than Oracle. If you need the syntax for formatting a date in Java you might do better posting this question in the Java forum.

    Mary

    Comment

    • ascanestro
      New Member
      • Feb 2007
      • 2

      #3
      Maybe it helps:

      select to_char(sysdate , 'DD/MM') from dual
      select to_char(sysdate , 'DD/MM/YY') from dual
      select to_char(sysdate , 'DD/MM/YYYY') from dual

      Originally posted by mmccarthy
      This sounds more like a Java question than Oracle. If you need the syntax for formatting a date in Java you might do better posting this question in the Java forum.

      Mary

      Comment

      • prafullnarkhede
        New Member
        • Feb 2007
        • 1

        #4
        try this :)
        select trunc(sysdate) from dual;
        You will get date without time.

        Comment

        Working...