date_format
Format a datetime.date or datetime.datetime object using a localizable format.
If use_l10n is provided and is not None, that will force the value to be localized (or not), otherwise it's always localized.
def date_format(
value: datetime.date | datetime.datetime,
format: string = None,
use_l10n: boolean = None
) - > string
Format a datetime.date or datetime.datetime object using a localizable format.
Parameters
| Name | Type | Description |
|---|---|---|
| value | `datetime.date | datetime.datetime` |
| format | string = None | The format string or named format (e.g., 'DATE_FORMAT') to apply; defaults to the system DATE_FORMAT if not provided. |
| use_l10n | boolean = None | A flag to force localization on or off; if None, the value is always localized. |
Returns
| Type | Description |
|---|---|
string | The formatted date string based on the specified format and localization settings. |