Truncate Clock Time

Truncate clock time to remove seconds or minutes. Round time to the nearest hour, minute, or custom interval.

Input text

Result

Tool options

Truncation Side

Truncate Only Seconds

Drop the seconds component from each clock time.

Truncate Minutes and Seconds

Drop both – the minutes and seconds components from each clock time.

Print Dropped Components

Display the dropped parts as zero values "00".

Time Padding

Make all time components always be two digits wide.


Truncate Clock Time Examples

Click to try!

Truncate Seconds

In this example, we get rid of the seconds part from several timer values. We select the "Truncate Only Seconds" mode and get a list of timer values consisting only of hours and minutes in format "hh:mm" (the ":ss" part is removed).

Truncation Side

Truncate Only Seconds

Drop the seconds component from each clock time.

Truncate Minutes and Seconds

Drop both – the minutes and seconds components from each clock time.

Print Dropped Components

Display the dropped parts as zero values "00".

Time Padding

Make all time components always be two digits wide.

Truncate Minutes and Seconds

This example truncates five clock times to an hour. It drops the minutes and seconds parts and only outputs the hours with zero padding.

Truncation Side

Truncate Only Seconds

Drop the seconds component from each clock time.

Truncate Minutes and Seconds

Drop both – the minutes and seconds components from each clock time.

Print Dropped Components

Display the dropped parts as zero values "00".

Time Padding

Make all time components always be two digits wide.

Set Seconds to Zero

In this example, we set the seconds part of each time to zero by first truncating the time to minutes and then appending a zero at the end in place of the truncated seconds. To do this, we switch on the seconds-truncation mode and activate the option to print-zero-time-parts. We also turn off the padding option and get the output time in format "h:m:s", where the seconds are always zero so the final format is "h:m:0".

Truncation Side

Truncate Only Seconds

Drop the seconds component from each clock time.

Truncate Minutes and Seconds

Drop both – the minutes and seconds components from each clock time.

Print Dropped Components

Display the dropped parts as zero values "00".

Time Padding

Make all time components always be two digits wide.


All Time Tools

Convert Days to Hours

Convert days to hours

Convert Hours to Days

Convert hours to days

Convert Seconds to Time

Convert seconds to time format

Convert Time to Seconds

Convert time format to seconds

Time Between Dates

Calculate time between two dates

Crontab Guru

Generate and understand cron expressions

Check Leap Years

Check if a year is a leap year

Convert Unix to Date

Convert Unix timestamp to date

Convert time to decimal

Convert human time to decimal time