def get_seconds(ts):
    """
    Converts the time object to number of seconds from beginning of the day
    :param ts: the time object
    :return: the number of seconds from beginning of the day
    """
    return ts.second + 60 * ts.minute + 3600 * ts.hour