Oracle - Date Datatype

About

Use the DATE data type to store point-in-time values (dates and times) in a table. An application that specifies the time for a job might use the DATE data type.

The DATE data type stores:

  • the century,
  • year,
  • month,
  • day,
  • hours,
  • minutes,
  • and seconds.

The valid date range is from January 1, 4712 BC to December 31, 9999 AD.

Use the TIMESTAMP data type to store values that are precise to fractional seconds. An application that must decide which of two events occurred first might use TIMESTAMP.

Articles Related

Formatting

The formatting of a date is controlled by the following parameters :

Snippet with the TO_CHAR function to give a specific format:

TO_CHAR(COLUMN_WITH_DATE_DATATYPE, 'YYYY/MM/DD HH24:MI:SS'),

Date Data Type Difference

SELECT
  (End_Date - Start_Date)*24*60*60 diff_in_secondes
FROM
  your_table

Documentation / Reference

  • Bookmark "Oracle - Date Datatype" at del.icio.us
  • Bookmark "Oracle - Date Datatype" at Digg
  • Bookmark "Oracle - Date Datatype" at Ask
  • Bookmark "Oracle - Date Datatype" at Google
  • Bookmark "Oracle - Date Datatype" at StumbleUpon
  • Bookmark "Oracle - Date Datatype" at Technorati
  • Bookmark "Oracle - Date Datatype" at Live Bookmarks
  • Bookmark "Oracle - Date Datatype" at Yahoo! Myweb
  • Bookmark "Oracle - Date Datatype" at Facebook
  • Bookmark "Oracle - Date Datatype" at Yahoo! Bookmarks
  • Bookmark "Oracle - Date Datatype" at Twitter
  • Bookmark "Oracle - Date Datatype" at myAOL
 
database/oracle/date.txt · Last modified: 2010/07/20 19:36 by gerardnico