{"id":9642,"library":"dateformat","title":"Dateformat","description":"Dateformat is a small Python library designed for quickly parsing and formatting dates using its own set of intuitive format codes. It wraps standard Python `datetime` objects for convenience. The current version is 0.9.7, with a relatively slow release cadence, last updated in mid-2022.","status":"active","version":"0.9.7","language":"python","source_language":"en","source_url":"https://github.com/stestagg/dateformat","tags":["date","time","formatting","parsing","datetime"],"install":[{"cmd":"pip install dateformat","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from dateformat import format","symbol":"DateFormat","correct":"from dateformat import DateFormat"},{"symbol":"AmPmPart","correct":"from dateformat import AmPmPart"},{"symbol":"EPOCH","correct":"from dateformat import EPOCH"}],"quickstart":{"code":"import dateformat\nimport datetime as std_datetime\n\n# Get a datetime object (can be standard datetime or dateformat.datetime)\nnow_dt = std_datetime.datetime.now()\n\n# Format a datetime object using dateformat's codes\nformatted_date = dateformat.format(now_dt, \"YYYY-MM-DD HH:MM:SS\")\nprint(f\"Formatted: {formatted_date}\")\n\n# Parse a date string using dateformat's codes\ndate_string = \"2023-10-27 14:35:01\"\nparsed_dt = dateformat.parse(date_string, \"YYYY-MM-DD HH:MM:SS\")\nprint(f\"Parsed: {parsed_dt}\")\n\n# Using dateformat's own datetime wrapper\ndf_now = dateformat.datetime.now()\nformatted_df_now = dateformat.format(df_now, \"Do MMMM YYYY\")\nprint(f\"Formatted (df.dt): {formatted_df_now}\")","lang":"python","description":"This example demonstrates how to use `dateformat.format` to convert a `datetime` object (either standard or `dateformat`'s wrapper) into a string, and `dateformat.parse` to convert a string into a `datetime` object, both utilizing `dateformat`'s unique format codes."},"warnings":[{"fix":"Always refer to the `dateformat` documentation for the correct format codes. Convert `%Y` to `YYYY`, `%m` to `MM`, `%d` to `DD`, `%H` to `HH`, `%M` to `II` (for minutes), `%S` to `SS` etc.","message":"Dateformat uses its own custom set of formatting codes (e.g., 'YYYY', 'MM', 'DD', 'HH') which are distinct from Python's standard `datetime.strftime`/`strptime` codes (e.g., '%Y', '%m', '%d', '%H'). Mixing these will lead to `ValueError` or incorrect output.","severity":"breaking","affected_versions":"All versions"},{"fix":"For formatting and parsing with `dateformat`'s codes, always use `dateformat.format(dt_object, format_string)` and `dateformat.parse(date_string, format_string)` respectively. Do not try to call `strftime` or `strptime` directly on `dateformat.datetime` objects with custom codes.","message":"The `dateformat.datetime` object is a wrapper around the standard `datetime.datetime` object. While convenient, direct calls to methods like `strftime()` or `strptime()` on `dateformat.datetime` instances will behave like standard `datetime` objects and will not use `dateformat`'s custom format codes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of the project's maintenance status. For actively developed alternatives with similar features, consider libraries like `pendulum` or `arrow`, which may offer more frequent updates and broader community support.","message":"The project has a slow release cadence, with the last stable release (v0.9.7) in July 2022. While functional, users should not expect rapid feature development, bug fixes, or immediate support for new Python versions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'-2022':46 '0.9.7':35 'cadenc':41 'code':22 'conveni':30 'current':32 'date':14,47 'dateformat':1,2 'datetim':27,51 'design':8 'format':13,21,49 'intuit':20 'last':42 'librari':7 'mid':45 'object':28 'pars':11,50 'python':6,26 'quick':10 'relat':38 'releas':40 'set':18 'slow':39 'small':5 'standard':25 'time':48 'updat':43 'use':15 'version':33 'wrap':24","created_at":"2026-04-17T01:19:57.812650+00:00","updated_at":"2026-04-17T01:19:57.812650+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.9.7","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/stestagg/dateformat","docs":null,"changelog":null,"pypi":"https://pypi.org/project/dateformat/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}