MAINT: Port _timelex in codebase
Removes the `DeprecationWarning` raised by `dateutil` because it's a private class.

Implementation taken from the following PR:

https://github.com/dateutil/dateutil/pull/732

Closes #21322.

cc @pganssle