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.
pip install dateformatVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
No dependency data recorded yet.