Created
March 17, 2021 10:05
-
-
Save dominiksimgen/6ba7a143ea9a04bcb14d34ecaf95f9cc to your computer and use it in GitHub Desktop.
parse datetime from string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openpyxl, os, datetime | |
here = os.path.dirname(os.path.abspath(__file__)) | |
os.chdir(here) | |
wb = openpyxl.load_workbook("mb51.xlsx") | |
sheet1 = wb[wb.sheetnames[0]] | |
date_time_str = sheet1.cell(4,3).value | |
date_time_obj = datetime.datetime.strptime(date_time_str, '%d.%m.%Y') | |
print(date_time_obj.isocalendar()[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment