from datetime import datetime


def _update_game(game, result):
    """Update game stats that change"""

    game.number_of_players = result["numberOfPlayers"] - result["openSlots"]
    game.end_of_game = result["endOfGame"]
    game.day_of_game = result["dayOfGame"]
    game.next_day_time = datetime.fromtimestamp(
        result["nextDayTime"] / 1000
    )

    return game