dates.py 632 B

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