'Convert from Python date to Excel JD.'

def to_julian(self, year, month, day, hours=0, minutes=0, seconds=0):

    if ((year < 1900) or (year > 10000)):
        msg = ('Year    not    supported    by    Excel:    %s' % year)
        raise ValueError(msg)
    if (self.excel_base_date == self.CALENDAR_WINDOWS_1900):
        if ((year == 1900) and (month <= 2)):
            excel_1900_leap_year = False
        else:
            excel_1900_leap_year = True
        excel_base_date = 2415020
    else:
        raise NotImplementedError('Mac    dates    are    not    yet    supported.')
    if (month > 2):
        month = (month - 3)
    else:
        month = (month + 9)
        year -= 1
    (century, decade) = (int(str(year)[:2]), int(str(year)[2:]))
    excel_date = (((((floor(((146097 * century) / 4)) + floor(((1461 * decade) / 4))) + floor((((153 * month) + 2) / 5))) + day) + 1721119) - excel_base_date)
    if excel_1900_leap_year:
        excel_date += 1
    if ((self.excel_base_date == self.CALENDAR_WINDOWS_1900) and (excel_date == 60)):
        msg = 'Error:    Excel    believes    1900    was    a    leap    year'
        raise ValueError(msg)
    excel_time = ((((hours * 3600) + (minutes * 60)) + seconds) / 86400)
    return (excel_date + excel_time)
