Date::Extract takes an arbitrary block of text, searches it for something that looks like a date string, and builds a DateTime object out of it. By design it will produce few false positives. This means it will not catch nearly everything that looks like a date string. So if you have the string "do homework for class 2019" it won't return a DateTime object with the year set to 2019. WWW: https://metacpan.org/release/Date-Extract