@staticmethod
	def to_excel_date(d):
		if isinstance(d, datetime):
			delta = d - DataTypes.EXCEL_BASE_DATE
			excel_date = delta.days + (float(delta.seconds) + float(delta.microseconds) / 1E6) / (60 * 60 * 24) + 1
			return excel_date + (excel_date > 59)
		elif isinstance(d, date):
			# this is why python sucks >.<
			return DataTypes.to_excel_date(datetime(*(d.timetuple()[:6])))
		elif isinstance(d, time):
			return DataTypes.to_excel_date(datetime(*(DataTypes.EXCEL_BASE_DATE.timetuple()[:3]), hour=d.hour, minute=d.minute, second=d.second, microsecond=d.microsecond)) - 1
dataset/ETHPy150Open kz26/PyExcelerate/pyexcelerate/DataTypes.py/DataTypes.to_excel_date/original