from datetime import datetime


def timestamp_to_weekday(timestamp):
    """
    Weekday as a decimal number, where 0 is Sunday and 6 is Saturday.
    """
    return int(datetime.fromtimestamp(timestamp / 1000.0).strftime("%w"))