from datetime import datetime as dt


def format_exif_date(datestring, input_format='%Y:%m:%d %H:%M:%S',
                     output_format='%Y%m%d%H%M%S') -> str:
    """Format an exif timestamp.

    Args:
        datestring (str): The datetime string to be formatted.
            A typical exif date format is: yyyy:mm:dd hh:mi:ss
        input_format (str): Format mask for the value passed to the
            ``datetime`` parameter
        output_format (str): Convert to this format.

    :Design:
        Function designed to convert the exif date/timestamp
        from 2010:01:31 12:31:18 (or a caller specified) format to a
        format specified by the caller.

        This is useful for storing an exif date as a datetime string.

    :Example:
        ::

            import utils3.utils as u
            newdate = u.format_exif_date('2010:01:31 12:31:18')

    Returns:
        A formatted datetime string.

    """

    # RETURN FORMATTED STRING
    return dt.strftime(dt.strptime(datestring, input_format), output_format)