def simple_time(value):
    """
    Format a datetime or timedelta object to a string of format HH:MM
    """
    if isinstance(value, timedelta):
        return ':'.join(str(value).split(':')[:2])
    return datetime_to_string(value, '%H:%M')
def simple_time ( value ) : if isinstance ( value , timedelta ) : return ':' . join ( str ( value ) . split ( ':' ) [ : 2 ] ) return datetime_to_string ( value , '%H:%M' )
Format a datetime or timedelta object to a string of format HH:MM