def _to_ordinalf(dt):
    '\n    Convert :mod:`datetime` or :mod:`date` to the Gregorian date as UTC float\n    days, preserving hours, minutes, seconds and microseconds.  Return value\n    is a :func:`float`.\n    '
    if (hasattr(dt, 'tzinfo') and (dt.tzinfo is not None)):
        delta = dt.tzinfo.utcoffset(dt)
        if (delta is not None):
            dt -= delta
    base = float(dt.toordinal())
    if isinstance(dt, datetime.datetime):
        cdate = dt.date()
        midnight_time = datetime.time(0, 0, 0, tzinfo=dt.tzinfo)
        rdt = datetime.datetime.combine(cdate, midnight_time)
        td_remainder = _total_seconds((dt - rdt))
        if (td_remainder > 0):
            base += (td_remainder / SEC_PER_DAY)
    return base
Convert :mod:`datetime` or :mod:`date` to the Gregorian date as UTC float
days, preserving hours, minutes, seconds and microseconds.  Return value
is a :func:`float`.
def _to_ordinalf(dt):
    '\n    Convert :mod:`datetime` or :mod:`date` to the Gregorian date as UTC float\n    days, preserving hours, minutes, seconds and microseconds.  Return value\n    is a :func:`float`.\n    '
    if (hasattr(dt, 'tzinfo') and (dt.tzinfo is not None)):
        delta = dt.tzinfo.utcoffset(dt)
        if (delta is not None):
            dt -= delta
    base = float(dt.toordinal())
    if isinstance(dt, datetime.datetime):
        cdate = dt.date()
        midnight_time = datetime.time(0, 0, 0, tzinfo=dt.tzinfo)
        rdt = datetime.datetime.combine(cdate, midnight_time)
        td_remainder = _total_seconds((dt - rdt))
        if (td_remainder > 0):
            base += (td_remainder / SEC_PER_DAY)
    return base