Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    4

    Unanswered: jsp, oracle and date

    hi
    I have date in my database in format dd-mm-yy, i'm writing it to base like that
    Code:
    ....TO_DATE('01-01-2005','DD-MM-YY')....
    I use query
    Code:
    select date_col from table;
    to display it in my jsp page, but in result I receive date in format day-month-year-time, and i want dd-mm-yy like in database
    when i check date in sqlplus console everything is ok, I use the same code in php script and it works
    can somebody help me

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Dates in the database are stored as numbers so they don't have any format. Try "select to_char(yourdate, 'MM-DD-YY') from yourtable" or format the Date object in the Java code.

  3. #3
    Join Date
    Jan 2005
    Posts
    362

    Date format

    If the other can not help you, you may try the "dateformat", I used it with access and dates at a project.
    Links below
    http://java.sun.com/j2se/1.4.2/docs/...ateFormat.html
    http://java.sun.com/j2se/1.4.2/docs/...ateFormat.html
    dimis

  4. #4
    Join Date
    Nov 2005
    Posts
    4
    thanks for help I found what I needed

Posting Permissions

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