def tt2000_to_datetime(self, tt2000):
    "\n        Converts a CDF TT2000 value to a datetime\n\n        .. note::\n            Although TT2000 values support leapseconds, Python's datetime\n            object does not. Any times after 23:59:59.999999 will\n            be truncated to 23:59:59.999999.\n\n\n        Parameters\n        ==========\n        tt2000 : int\n            TT2000 value from CDF\n\n        Raises\n        ======\n        EpochError : if input invalid\n\n        Returns\n        =======\n        out : :class:`datetime.datetime`\n            date and time corresponding to epoch. Invalid values are set to\n            usual epoch invalid value, i.e. last moment of year 9999.\n\n        See Also\n        ========\n        v_tt2000_to_datetime\n        "
    yyyy = ctypes.c_double(0)
    mm = ctypes.c_double(0)
    dd = ctypes.c_double(0)
    hh = ctypes.c_double(0)
    min = ctypes.c_double(0)
    sec = ctypes.c_double(0)
    msec = ctypes.c_double(0)
    usec = ctypes.c_double(0)
    nsec = ctypes.c_double(0)
    self._library.breakdownTT2000(ctypes.c_longlong(tt2000), ctypes.byref(yyyy), ctypes.byref(mm), ctypes.byref(dd), ctypes.byref(hh), ctypes.byref(min), ctypes.byref(sec), ctypes.byref(msec), ctypes.byref(usec), ctypes.byref(nsec))
    if (yyyy.value <= 0):
        return datetime.datetime(9999, 12, 13, 23, 59, 59, 999999)
    sec = int(sec.value)
    if (sec >= 60):
        return datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), 59, 999999)
    micro = int(((((msec.value * 1000) + usec.value) + (nsec.value / 1000)) + 0.5))
    if (micro < 1000000):
        return datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), sec, micro)
    else:
        add_sec = int((micro / 1000000))
        try:
            return (datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), sec, (micro - (add_sec * 1000000))) + datetime.timedelta(seconds=add_sec))
        except OverflowError:
            return datetime.datetime(datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999)
Converts a CDF TT2000 value to a datetime

.. note::
    Although TT2000 values support leapseconds, Python's datetime
    object does not. Any times after 23:59:59.999999 will
    be truncated to 23:59:59.999999.


Parameters
==========
tt2000 : int
    TT2000 value from CDF

Raises
======
EpochError : if input invalid

Returns
=======
out : :class:`datetime.datetime`
    date and time corresponding to epoch. Invalid values are set to
    usual epoch invalid value, i.e. last moment of year 9999.

See Also
========
v_tt2000_to_datetime
def tt2000_to_datetime(self, tt2000):
    "\n        Converts a CDF TT2000 value to a datetime\n\n        .. note::\n            Although TT2000 values support leapseconds, Python's datetime\n            object does not. Any times after 23:59:59.999999 will\n            be truncated to 23:59:59.999999.\n\n\n        Parameters\n        ==========\n        tt2000 : int\n            TT2000 value from CDF\n\n        Raises\n        ======\n        EpochError : if input invalid\n\n        Returns\n        =======\n        out : :class:`datetime.datetime`\n            date and time corresponding to epoch. Invalid values are set to\n            usual epoch invalid value, i.e. last moment of year 9999.\n\n        See Also\n        ========\n        v_tt2000_to_datetime\n        "
    yyyy = ctypes.c_double(0)
    mm = ctypes.c_double(0)
    dd = ctypes.c_double(0)
    hh = ctypes.c_double(0)
    min = ctypes.c_double(0)
    sec = ctypes.c_double(0)
    msec = ctypes.c_double(0)
    usec = ctypes.c_double(0)
    nsec = ctypes.c_double(0)
    self._library.breakdownTT2000(ctypes.c_longlong(tt2000), ctypes.byref(yyyy), ctypes.byref(mm), ctypes.byref(dd), ctypes.byref(hh), ctypes.byref(min), ctypes.byref(sec), ctypes.byref(msec), ctypes.byref(usec), ctypes.byref(nsec))
    if (yyyy.value <= 0):
        return datetime.datetime(9999, 12, 13, 23, 59, 59, 999999)
    sec = int(sec.value)
    if (sec >= 60):
        return datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), 59, 999999)
    micro = int(((((msec.value * 1000) + usec.value) + (nsec.value / 1000)) + 0.5))
    if (micro < 1000000):
        return datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), sec, micro)
    else:
        add_sec = int((micro / 1000000))
        try:
            return (datetime.datetime(int(yyyy.value), int(mm.value), int(dd.value), int(hh.value), int(min.value), sec, (micro - (add_sec * 1000000))) + datetime.timedelta(seconds=add_sec))
        except OverflowError:
            return datetime.datetime(datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999)