def time_to_vega(time):
    """
    Convert an `~astropy.time.Time` object into a string compatible with Vega.
    """
    year, month, day, hour, minute, second = time.datetime.timetuple()[:6]
    month -= 1
    return f'datetime({year}, {month}, {day}, {hour}, {minute}, {second})'
