Skip to content
UniKit

Time formatter

Normalize pasted times into one spelling: switch between 12 and 24-hour clocks, trim seconds or milliseconds, zero-pad hours, use Chinese forms such as HH时mm分ss秒 or a custom template, keeping any timezone offset as written.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Times (one per line)

Accepts 03:04, 03:04:05, 03:04:05.500, 3:04 PM, 3:04 p.m., 上午/下午 3:05, 12时30分5秒, 10点05分 and values with +08:00 or Z. A leading date is ignored — this tool outputs the time part only.

Formatted result

Purely a spelling change: an input offset is kept (normalized to ±HH:MM) and never converted between zones.

Enter a time to see the result

Characters: 0 · Output lines: 0 · Formatted: 0 · Errors: 0

What this tool does

  • Normalize a paste of mixed 12-hour and 24-hour times into one spelling, for example 3:04 PM → 15:04.
  • Trim times to the second or minute (or pad them) for logs, reports and import templates.
  • Rewrite times into Chinese forms such as 15时04分05秒, or into your own template, keeping any timezone offset.

Example

Input

2026-01-02 3:04:05 PM

Output

15:04:05

A leading date is ignored — only the time part is formatted. Use the date & time converter when you need the date converted too.

Frequently asked questions

How does this differ from the date & time converter?

This tool handles the time part only: 12/24-hour switching, trimming seconds or milliseconds, padding, Chinese forms and custom templates. Any date in the input is ignored and timezones are never converted. The date & time converter covers the full date+time set — ISO 8601, Chinese format, Unix seconds/milliseconds, weekday, relative values and templates.

Does an input such as +08:00 or Z get converted?

No. Only the spelling is normalized: +0800 becomes +08:00 and Z stays Z, but the value is never shifted by a timezone. Use the date & time converter if you need an actual zone conversion.

What happens when a template and the precision options are both set?

The template wins: once it is filled in, the 12/24-hour switch, precision and padding options no longer affect the output. Inside the template, HH/H and hh/h control padding while ss and SSS control whether seconds and milliseconds appear.

Which spellings are recognized?

Colon forms (03:04, 03:04:05, 03:04:05.500), 12-hour forms (3:04 PM, 3:04 p.m., 上午/下午 3:05, 中午12:30), Chinese forms (12时30分, 12时30分5秒, 10点05分) and trailing offsets such as +08:00, +0800 or Z. A line with a date but no time (for example 2026-01-02) is reported separately.

How is zero padding controlled?

The default is automatic: padded in 24-hour mode (09:04) and unpadded in 12-hour mode (9:04 AM). You can force always or never padded, and the HH/H or hh/h symbols give exact control inside a template.

Keywords:time formatter12 hour to 24 hourtime-format

Related tools