Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        	@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
        


src/p/y/PyExcelerate-0.5.0/pyexcelerate/Worksheet.py   PyExcelerate(Download)
				self._cell_cache[cell] = '" t="inlineStr"><is><t>%s</t></is></c>' % escape(cell)
			elif type == DataTypes.DATE:
				self._cell_cache[cell] = '"><v>%s</v></c>' % (DataTypes.to_excel_date(cell))
			elif type == DataTypes.FORMULA:
				self._cell_cache[cell] = '"><f>%s</f></c>' % (cell)