1

I was using the library datetime and xlwt i wanted to create a sheet name and i want to add the date and time is has been created so i used the following lines.

sheet1 = wb.add_sheet('applied job list'+datetime.now())

it throwed an error saying

 File "d:/PROJECTS/job_apply_bot/aasda.py", line 5, in <module>
    sheet1 = wb.add_sheet('applied job list'+datetime.now())
TypeError: can only concatenate str (not "datetime.datetime") to str

idk what i am missing can someone help

1 Answer 1

1

Looks like your returning an object with datetime.now() try converting it to a string first like this,

sheet1 = wb.add_sheet('applied job list' + str(datetime.now()))

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.