You are offline

Switched to Home view. Returning to your route when internet connects.

← Back to Knowledge Center
Coding
Published:Nov 28, 2026
•
Updated:Nov 28, 2026
•4 min read

Flashdate – a drop-in for Python's dateparser, 100x faster

Flashdate – a drop-in for Python's dateparser, 100x faster
Aditya Verma

Aditya Verma

Contributor & Platform Mentor

Writes about programming, productivity, and online learning.

Tbh, this is something I struggled with for a while, so I hope it helps someone.

dateparser reads dates the way people write them: "March 5, 2024", "le 5 mars 2024", "3 days ago". It is downloaded about 45 million times a month, and it is slow. One ISO date takes it about 670 microseconds. A scraper that reads ten million dates spends about two hours on it.

flashdate is a modified copy of dateparser with the same API and the same results. It reads common date formats 100 to 250 times faster, and it is still pure Python.

Making it fast was the easier half. The harder half was knowing that it still gives the same answer for every string. This article covers both.

Why dateparser is slow

dateparser does not know the language of a string in advance. For every string it works out which of its 205 languages could apply, translates the words to English, splits the result into tokens, and tries several parsers in turn.

An ISO date like `2024-03-05` goes through all of these steps, although nothing in it needs translating.

What flashdate does differently

Three changes give most of the speed.

  • Direct routes for common shapes. ISO dates, numeric dates like 03/05/2024, and dates with month names in English and six other languages are recognised by their shape and read straight away. Anything else goes through the full steps, as before. On dateparser's own evaluation set of 300,000 article dates, 80% take a direct route.
    tbh, - Languages are skipped early. A language is skipped when the string contains a letter or a word that the language cannot have.
    tbh, - Work is done once. The list of languages is built once, not for every date. Time zones are searched once per string. Known words are matched with a prefix tree.

!Two columns. dateparser: the string 2024-03-05 goes through four steps (find which of 205 languages could fit, translate the words to English, split the text into tokens, try several parsers in turn) and takes 672 microseconds. flashdate: it checks whether the string has a known shape, reads it directly, and takes 4.8 microseconds. Any other string takes dateparser's full steps, as before.

datetime.datetime(2024, 3, 5, 0, 0)
Code

## Moving an existing codebase

It takes one changed line per file. Change the import and leave the rest of the code alone:

```python
# before
import dateparser

# after
import flashdate as dateparser

Every call below that line stays as it is: `dateparser.parse(...)`, the `settings`, the `languages`, `DateDataParser`. Where you import from a submodule, only the package name changes:

Python
from flashdate.search import search_dates
from flashdate.date import DateDataParser

You do not have to take my word for the results. Check them on your own data first:

tbh, 1. Install flashdate. It does not replace dateparser, so nothing changes yet. 2. Run both on a sample of your own dates and compare. 3. Switch the import. To go back, change that one line back.

Python
import dateparser
import flashdate

for text in my_dates:
assert flashdate.parse(text) == dateparser.parse(text), text

Relative dates such as "3 days ago" depend on the current time. To compare those, pass the same `RELATIVE_BASE` setting to both.

It installs next to dateparser under its own name, so you can run both and compare. If you find a string where they differ, that is a bug: please [open an issue](

The design, the language data and the tests are the work of dateparser's maintainers. flashdate keeps their licence and only changes how fast the answers come. Code, benchmarks and the comparison scripts:

{% embed %}

Let me know if you've run into this as well. Happy coding!

Comments (0)

No comments yet. Be the first to join the dialogue!