I am having issues parsing data from my Excel file using openpyxl. In the excel file the cell is expected to have a value of "9/22/2016 8:00" in the cell format m/d/yyyy h:mm.
However when I extract the data from the cell and print it I receive a datetime.datetime object that is incorrect.
from openpyxl import load_workbook wbk = load_workbook("file.xlsx") sheet = wbk.get_sheet_by_name("Sheet 1") value = sheet["E367"].value print value
Outputs the following:
2016-09-22 07:59:59.999997 instead of
What can I do to obtain the desired output? I tried to turn off data type guessing, and just using the
internal value 42635.3333333 but I am unaware how to use that data to construct a datetime.datetime object.