#1
  1. The Basketball Star
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2001
    Location
    H-Town
    Posts
    550
    Rep Power
    14

    Oracle and dates


    Now, I'm just getting introduced to Oracle. I'm migrating from MySQL, which right now seems so simple and Oracle seems very complicated. Anyway, I have a couple of questions about dates in Oracle. In MySQL, dates had to be entered into a field in the format "YYYY-MM-DD" and then you could use this date function called DATE_FORMAT() to format the date in pretty much anyway you want. Anyway, what is the default Oracle date format and what statement would I have to use to format a date to "March, 1999" or "March 19, 1999" for example?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    15
    The standard date format in Oracle is like this

    11-JUL-2002

    You could use this to change the date format

    TO_DATE('01 July 2002','DD Month YYYY')

    or

    TO_DATE('January 15, 1989, 11:00A.M.', 'Month dd, YYYY, HH:MI A.M.')

    An explanation of the TO_DATE function can be found here:

    http://info-it.umsystem.edu/oracle/s...lr.2.0173.html

    wabirdman
    Last edited by wabirdman; July 10th, 2002 at 07:18 PM.
    Real programmers code in binary

IMN logo majestic logo threadwatch logo seochat tools logo