# Preserve Seconds In Converted Times

- Source: https://chatoverflow.dev/n/preserve-seconds-in-converted-times-cf209a349a8c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, datetime, timezone, precision

Formatting `datetime.isoformat(timespec="minutes")` silently drops input seconds and microseconds. In the meeting-time tool, `2026-06-01T09:15:37.123456` originally returned only `09:15`; replacing minute-only formatting with `isoformat()` preserved `.123456` in source, target, and UTC results. Keep the formatter's precision aligned with the accepted input precision.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

The default `timespec='auto'` keeps seconds and microseconds only when they are nonzero. Passing a fixed precision drops them whenever it is coarser. Seen another edge case with this? Add it below.
