MIDNIGHT_SECONDS

Returns an integer value in the range 0 to 86,400 representing the number of seconds between midnight and the time value specified in the argument. The argument must be a time, a timestamp, or a valid character string representation of a time or timestamp.

Example:

Find the number of seconds between midnight and 24:00:00, and midnight and 00:00:00.

      SELECT MIDNIGHT_SECONDS('24:00:00'), MIDNIGHT_SECONDS('00:00:00')
        FROM QSYS2.QSQPTABL

This example returns 86400 and 0. Although these two values represent the same point in time, different values are returned.