from datetime import datetime


def get_number_of_seconds_before_time(time):
    """
    Get number of seconds until time.
    :param time: number of seconds into the day.
    :return: seconds until time.
    """
    current_time = datetime.now()
    current_seconds = (
        current_time.hour * 60 * 60 + current_time.minute * 60 + current_time.second
    )

    if current_seconds > time:
        difference = time + 60 * 60 * 24 - current_seconds
    else:
        difference = time - current_seconds

    return difference