from typing import Optional
from datetime import datetime


def date_to_day_of_week(date: Optional[str] = None) -> int:
    """
    Convert a date into day of week
    :param date: Optional. If not passed in, then current day is used.
    :return: Day of the week starting with [0=Monday, 6=Sunday]
    """
    if date is None:
        day_of_week = datetime.now().timetuple().tm_wday
    else:
        m, d, y = date.split('-')
        day_of_week = datetime(int(y), int(m), int(d)).timetuple().tm_wday
    return day_of_week