#4150·date-fns

`intervalToDuration` produces negative hours/minutes despite `end` after `start`

Author: helciofrancoCreated Jan 28, 2026Updated Aug 24, 2026

intervalToDuration returns negative hours/minutes despite end > start.

Demo

typescript
import { intervalToDuration, parseISO } from 'date-fns';

intervalToDuration({
  start: parseISO('2026-01-28 22:45:00+00'),
  end: parseISO('2026-02-28 16:23:00+00')
});
//=> { months: 1, hours: -6, minutes: -22 }