Calculate date 5 days from today, adding an extra day for each day in the next 5 days that is a weekend day
问题 I am testing using Robot Framework and need to create my own Python keyword. Taking the current date as day 0 (tomorrow as day 1), I am trying to calculate what the date will be 5 days from today. If any of the days in the next 5 days is a Saturday I need to add an extra day to my calculation. Same if any of the days is a Sunday. As a Python beginner, I'm a little out of my depth so any help would be much appreciated 回答1: Basically you need to add 5 business days... This should do it: import