Oracle trunc truncation date function truncation Date: www.2cto.com first run the command: alter session set nls_date_format = 'yyyy-mm-dd hh24: mi: hh'; capture today: SQL> select sysdate, trunc (sysdate, 'dd') from dual; sysdate trunc (SYSDATE, 'dd') ----------------- ----------------------- 21:31:17 00:00:00 intercept the first day of the week: SQL> select sysdate, trunc (sysdate, 'D') from dual; sysdate trunc (SYSDATE, 'D') --------------------------------------- 21:29:32 on the first day of the month is intercepted: SQL> select sysdate, trunc (sysdate, 'mm ') from dual; sysdate trunc (SYSDATE, 'mm') ----------------- --------------------- 21:30:30 capture the first day of the year: SQL> select sysdate, trunc (sysdate, 'y') from dual; sysdate trunc (SYSDATE, 'y') ------------------- 21:31:57 to hour: SQL> select sysdate, trunc (sysdate, 'hh') from dual; SYSDATE TRUNC (SYSDATE, SYSDATE, 'hh') ----------------- ------------------- 21:32:59 on the morning of: SQL> select sysdate, trunc (sysdate, 'mi ') from dual; SYSDATE TRUNC (SYSDATE, 'mi ') ------------------- 21:33:32 21:33:00