Combining TO_CHAR() and TO_DATE() Calls : Date « SQL Data Types « Oracle PL/SQL Tutorial






The following query combines TO_CHAR() and TO_DATE() to view just the time part of a datetime.

SQL> SELECT TO_CHAR(TO_DATE('05-FEB-1968 19:32:36',
  2   'DD-MON-YYYY HH24:MI:SS'), 'HH24:MI:SS')
  3  FROM dual;

TO_CHAR(
--------
19:32:36

SQL>








10.6.Date
10.6.1.Process and store a specific date and time.
10.6.2.Use the DATE keyword to supply a date literal to the database.
10.6.3.Cast string to date in where clause
10.6.4.Setting the Default Date Format
10.6.5.Storing and Retrieving Dates
10.6.6.Default time field
10.6.7.Combining TO_CHAR() and TO_DATE() Calls
10.6.8.Converting a DATE to Another Language
10.6.9.Compare date type value in where clause
10.6.10.Query for NULL Date type data
10.6.11.TRUNC(Start_date)
10.6.12.TO_CHAR(start_date, 'MM-DD-YYYY HH24:MI')
10.6.13.Call SYSDATE in insert statement
10.6.14.Check Date format before inserting
10.6.15.Add condition constraint to date type column
10.6.16.Greater than a date
10.6.17.BETWEEN for date type value
10.6.18.Date calculation