How do I sort a list of orders by date from oldest to newest?

Put the date at the start of every line as year-month-day, such as 2026-01-20, with a leading zero on single-digit months and days, then sort ascending. In that format alphabetical order is chronological order. The common day/month/year format makes the sorter order by day first, which mixes up months and years.

Published · 3 min read

Why day/month/year fails

The sorter has no idea the text is a date. It compares lines from their first character, and the first thing it meets in «15/12/2025» is the day, 15. Sorting three orders dated 01/09/2026, 15/12/2025 and 20/01/2026 returned them unchanged: 01/09, then 15/12, then 20/01. The oldest order, from December 2025, sits in the middle because day 15 falls between 01 and 20.

The result looks sorted at a glance because the days go up, and that is what makes the mistake dangerous: you can send an order report without noticing that September came before the previous December.

The format that sorts itself: year-month-day

Starting with the year, then the month, then the day puts the most significant part first, so alphabetical order matches time order. The same orders written as «2026-09-01 order», «2025-12-15 order», «2026-01-20 order» came out of an ascending sort as 2025-12-15, 2026-01-20, 2026-09-01. Oldest to newest, no extra options needed.

To show the newest first, as on an order dashboard, choose descending: 2026-09-01, then 2026-01-20, then 2025-12-15.

Keep the leading zeros

Write 2026-9-1 instead of 2026-09-01 and the problem is back. Sorting 2026-9-1, 2026-10-5 and 2026-1-20 without numeric sorting gave 2026-1-20, 2026-10-5, 2026-9-1, so October came before September. Turning on «Numeric sorting» rescues this case, because it reads 9 and 10 as numbers: 2026-1-20, 2026-9-1, 2026-10-5. Still, the safe habit is to keep the zeros, so the list is right whatever the settings.

Steps

  1. Export the orders from your store (Salla, Zid, Shopify or anything else) or copy them from your sheet, and make the date the first column in year-month-day form. In a spreadsheet, changing the date cell format before copying is enough.
  2. Paste the lines into the Line sorter, one order per line.
  3. Choose «Ascending» for oldest first or «Descending» for newest first.
  4. Copy the result or download it as a text file.

Practical notes

  • Two orders on the same day are ordered by whatever follows the date. If the order number comes right after it with the same number of digits, the lower number comes first: 2025-12-15 #0871, then 2026-09-01 #1039, then 2026-09-01 #1043.
  • Hijri dates work on the same principle if written year-month-day, but do not mix Hijri and Gregorian dates in one list.
  • Dates in Arabic-Indic digits such as ٢٠٢٦-٠١-٢٠ sort correctly too, and in my test the order stayed chronological even when they were mixed with Western digits in the same list. A mixed list is hard to read, though, so unify the digits with the Arabic/Persian/Western digit converter before you send it to anyone.

Common questions

Can the tool turn 15/12/2025 into 2025-12-15?

No. It only sorts and never edits your lines, so the format change happens in your sheet or store system before you copy.

What about the time of day?

Write it after the date in 24-hour form with leading zeros, such as 2026-09-01 08:30, and the order stays chronological.