User Rating 0.0
Total Usage 0 times
Category Time
Accepts HH:MM:SS.mmm, HH:MM:SS, HH:MM, 12h AM/PM, or decimal hours
Quick Presets
Is this tool helpful?

Your feedback helps us improve.

About

Time truncation removes lower-order components from a time value without rounding. Given t = 14:37:52.841, truncating to minutes yields 14:37:00.000, not 14:38:00.000. This distinction matters in billing systems, log correlation, and time-series data alignment where rounding introduces forward bias. Payroll systems truncating to the quarter-hour can shift thousands of dollars annually per employee depending on whether they round or truncate. Database timestamps truncated inconsistently across services cause join failures and phantom duplicates in event pipelines.

This tool parses time in multiple notations - HH:MM:SS.mmm, 12-hour with AM/PM, decimal hours, and bare HH:MM - then applies floor division at the chosen unit boundary. The operation is idempotent: truncating an already-truncated value returns the same value. Note: this tool operates on wall-clock time values, not durations spanning multiple days. Inputs exceeding 23:59:59.999 are clamped.

time truncation clock time time precision truncate time time rounding down time calculator time format

Formulas

The truncation operation converts a time value t into total milliseconds T, then applies floor division by the unit size U in milliseconds:

Ttrunc = floor(TU) × U

Where T = total time in milliseconds, computed as:

T = h × 3600000 + m × 60000 + s × 1000 + ms

And U is the unit boundary in milliseconds:

{
U = 3600000 if truncating to hoursU = 60000 if truncating to minutesU = 1000 if truncating to secondsU = 100 if truncating to 100msU = 10 if truncating to 10ms

The discarded portion is: D = T Ttrunc. The operation is idempotent: trunc(trunc(t)) = trunc(t).

Reference Data

Input TimeTruncate ToResultDiscarded
14:37:52.841Hour14:00:00.00037m 52.841s
14:37:52.841Minute14:37:00.00052.841s
14:37:52.841Second14:37:52.0000.841s
14:37:52.841100ms14:37:52.80041ms
14:37:52.84110ms14:37:52.8401ms
09:59:59.999Hour09:00:00.00059m 59.999s
23:59:59.999Minute23:59:00.00059.999s
00:00:00.001Second00:00:00.0001ms
12:00:00.000Hour12:00:00.0000ms
3:45 PMMinute15:45:00.0000s
11:30 PMHour23:00:00.00030m 0s
7.75 (decimal hours)Hour07:00:00.00045m 0s
0:00:00.000Any00:00:00.0000ms
06:14:59.99510ms06:14:59.9905ms
18:29:30.500100ms18:29:30.5000ms

Frequently Asked Questions

Truncation always removes the sub-unit portion toward zero. Rounding evaluates whether the sub-unit portion exceeds half the unit and may round up. For example, 14:37:52 truncated to minutes gives 14:37:00, but rounding gives 14:38:00 because 52 seconds exceeds the 30-second midpoint. In payroll and billing, this distinction can shift costs significantly over thousands of records.
When aggregating events into fixed-width time buckets (e.g., 1-minute candles in financial data), truncation assigns each event to the bucket whose start time is the event time. This guarantees every event maps to exactly one bucket with no forward leakage. Rounding would cause events near a bucket boundary to spill into the next bucket, creating off-by-one aggregation errors.
Yes. Input like 3:45 PM or 11:30:15 AM is parsed correctly. 12:00 AM maps to 00:00 and 12:00 PM maps to 12:00 in 24-hour notation. The AM/PM detection is case-insensitive.
The result is 23:00:00.000. The tool discards 59 minutes, 59.999 seconds. There is no wraparound to the next day because the tool operates on single wall-clock values within the 00:00:00.000 - 23:59:59.999 range.
Yes. A bare decimal number is interpreted as hours. 7.75 equals 7 hours and 45 minutes (07:45:00.000). Truncating that to hours yields 07:00:00.000. Values exceeding 24 are clamped to 23:59:59.999.
Idempotence means applying the operation twice produces the same result as applying it once: trunc(trunc(t)) = trunc(t). This property is critical in distributed systems where the same normalization step might execute on multiple nodes. Without idempotence, repeated processing would progressively shift the value.