Hi guys, I always find difficult to manipulate date. Here, I’m look for a way to convert a given day to date. for example if the input is Mon, it will convert it to date which is 12. and if I supply like Sun, it will return the date which is 11, etc. I know this is python related but I’m sorry for asking here.
But if you enter “Mon”, how does your program determine that it should be “12” and not “5”, “19” or “26”? Are you always looking for the next such occurrence of that day?
If so, I’d get today’s day, find the difference between the days, then add that as a timedelta to today’s date. (See the Python datetime module for more information.) Also consider the case where the person enters “Fri” on a Friday - does that mean today (9) or next Friday (16)?