TRUNC (dates) function in Oracle

TRUNC (dates) is one of the vital Date/Time functions of Oracle. It is used to get a date truncated to a specific unit of measure. The TRUNC (dates) function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.


TRUNC ( date, format )

date: It is used to specify the date to be truncated.
format: It is an optional parameter which is used to specify the unit of measure to be used for truncating.

Example 1:

TRUNC( TO_DATE ('22-AUG-19'),'YEAR')



The result is the truncated date as per the YEAR format.

Please Share