from datetime import datetime
import traceback


def convert_datetime(date_string, date_format='%A %d. %B %Y, %H:%M'):
    """converts date string of format WEEKDAY DD. MONTH YYYY, HH:MM into date format"""

    try:
        # Convert Dates of sort Sonntag 9. Juni 2019, 09:00 as date format
        date_obj = datetime.strptime(date_string.strip(), date_format)
    except:
        date_obj = datetime(1900, 1, 1)
        print(traceback.format_exc())
    return date_obj