from datetime import datetime


def get_Mk_global(date):
    """
    Based on the script BackRuns_OneSite_ByDay.ksh, calculating the globalMetMk value
    :param date: datetime object
    :return: integer representing the globalMetMk value
    """

    seconds = int(datetime.strftime(date, "%s"))

    if seconds < 1136073600:
        return 0
    elif seconds < 1230768000:
        return 3
    elif seconds < 1257811200:
        return 4
    elif seconds < 1268092800:
        return 5
    elif seconds < 1367280000:
        return 6
    elif seconds < 1405382400:
        return 7
    elif seconds < 1440460800:
        return 8
    elif seconds < 1499731200:
        return 9
    else:
        return 10