'Convert from python datetime to excel julian date representation.'

def datetime_to_julian(self, date):

    if isinstance(date, datetime.datetime):
        return self.to_julian(date.year, date.month, date.day, hours=date.hour, minutes=date.minute, seconds=date.second)
    elif isinstance(date, datetime.date):
        return self.to_julian(date.year, date.month, date.day)
