from datetime import datetime


def format_datetime(value: datetime, dt_format: str = r"%d %b %Y %I:%M %p") -> str:
    """Formats a datetime object into a datetime string"""
    return value.strftime(dt_format)