★LocalHost Run Under Construction
  • Home
  • Articles
  • Tools
http://localhost
HomeArticlesTools
All tools›Time Tools›Truncate Clock Time

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 — Parse and explain cron expressions in plain English
  • Check Leap Years — Check if a year is a leap year
  • Convert Unix ↔ Date — Convert Unix timestamps and dates in both directions.
  • Convert time to decimal — Convert human time to decimal time
  • Discord Timestamp Generator — Generate Discord timestamps from dates

LocalHost Run · Contact · Privacy Policy · Terms of Use

© 2026 LocalHost Run · localhost guides, articles, and developer tools · localhostrun.com
Visitors: 1025Best viewed in Netscape Navigator · 800×600© LocalHost Run