converting string 'yyyy-mm-dd' into datetime python [duplicate]
This question already has an answer here: Converting string into datetime 19 answers I have a raw input from the user such as "2015-01-30"...for the query I am using, the date has to be inputed as a string as such "yyyy-mm-dd". I would like to increment the date by 1 month at end of my loop s.t "2015-01-30" becomes "2015-02-27" (ideally the last business day of the next month). I was hoping someone could help me; I am using PYTHON, the reason I want to convert to datetime is I found a function to add 1 month. Ideally my two questions to be answered are (in Python): 1) how to convert string