dates.py 668 B

12345678910111213141516171819202122232425
  1. """
  2. config for datetime formatting
  3. """
  4. from __future__ import annotations
  5. from pandas._config import config as cf
  6. pc_date_dayfirst_doc = """
  7. : boolean
  8. When True, prints and parses dates with the day first, eg 20/01/2005
  9. """
  10. pc_date_yearfirst_doc = """
  11. : boolean
  12. When True, prints and parses dates with the year first, eg 2005/01/20
  13. """
  14. with cf.config_prefix("display"):
  15. # Needed upstream of `_libs` because these are used in tslibs.parsing
  16. cf.register_option(
  17. "date_dayfirst", False, pc_date_dayfirst_doc, validator=cf.is_bool
  18. )
  19. cf.register_option(
  20. "date_yearfirst", False, pc_date_yearfirst_doc, validator=cf.is_bool
  21. )