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