Date Interval Sorter
Sort date ranges by start, end, or duration. Parse multiple formats, detect overlaps, calculate gaps. Export sorted intervals.
Supported: YYYY-MM-DD, MM/DD/YYYY, DD.MM.YYYY, March 15, 2024
No intervals added. Enter dates above to begin.
About
Date intervals compound complexity when unsorted. Project timelines, booking systems, and scheduling conflicts demand precise chronological ordering. Manual sorting invites errors - a single misplaced range cascades into scheduling collisions or resource conflicts. This tool parses intervals in ISO-8601 (2024-01-15), European (15.01.2024), and US (01/15/2024) formats, computing duration as d = end − start in milliseconds, then converting to human-readable days and hours.
The sorting engine implements stable comparison: intervals with identical primary keys preserve input order. Overlap detection applies the intersection test where two intervals A and B overlap when Astart ≤ Bend ∧ Bstart ≤ Aend. Gap analysis identifies unoccupied periods between consecutive sorted ranges. Results persist locally, surviving browser sessions. Assumes all dates share a common timezone context - cross-timezone intervals require manual UTC normalization before input.
Formulas
Interval duration is computed as the absolute difference between endpoint timestamps:
where tend and tstart represent Unix timestamps in milliseconds. Conversion to days applies:
Two intervals A = [a1, a2] and B = [b1, b2] overlap when both conditions hold:
Gap detection between consecutive sorted intervals identifies unoccupied spans:
The comparator function for stable sorting uses lexicographic ordering on selected keys:
where key ∈ {start, end, duration, label}.
Reference Data
| Input Format | Pattern | Example | Region |
|---|---|---|---|
| ISO-8601 | YYYY-MM-DD | 2024-03-15 | International |
| ISO with Time | YYYY-MM-DDTHH:MM | 2024-03-15T14:30 | International |
| US Format | MM/DD/YYYY | 03/15/2024 | United States |
| European Format | DD.MM.YYYY | 15.03.2024 | Europe |
| UK Format | DD/MM/YYYY | 15/03/2024 | United Kingdom |
| Long Month | Month DD, YYYY | March 15, 2024 | International |
| Short Month | DD Mon YYYY | 15 Mar 2024 | International |
| Compact | YYYYMMDD | 20240315 | Technical |
| Sort Criteria | Description | Use Case |
|---|---|---|
| Start Date (Asc) | Earliest start first | Project timelines, chronological review |
| Start Date (Desc) | Latest start first | Recent-first analysis |
| End Date (Asc) | Earliest end first | Deadline prioritization |
| End Date (Desc) | Latest end first | Long-term planning |
| Duration (Asc) | Shortest intervals first | Quick task identification |
| Duration (Desc) | Longest intervals first | Major project focus |
| Label (A-Z) | Alphabetical by name | Reference lookup |
| Duration Unit | Milliseconds | Conversion |
|---|---|---|
| Second | 1,000 | 1 s |
| Minute | 60,000 | 60 s |
| Hour | 3,600,000 | 60 min |
| Day | 86,400,000 | 24 h |
| Week | 604,800,000 | 7 d |
| Month (avg) | 2,629,746,000 | 30.44 d |
| Year (avg) | 31,556,952,000 | 365.25 d |