Relative Content

Tag Archive for pythondatetime

Date functions: trying to get dates 6 months in advance with certain criteria

I need to track attendance and progress over 6 months, I have to schedule meetings monthly to check in with clients, I work part time Monday to Wednesday so the meetings have to be on these days. I am new to python and I am having trouble Writing a code in python which generates dates six months from a start date, but only returns dates Monday to Wednesday and excludes weekend. I also need to excluded holidays.
Any help is appreciated. Thanks in advance

python `(datetime.datetime.now() – datetime.datetime.now()).seconds` does not return 0 seconds [duplicate]

This question already has an answer here: Why does datetime.datetime.now() – datetime.datetime.now() equal to datetime.timedelta(-1, 86399, 999974)? (1 answer) Closed 1 hour ago. I’m working with python 3.12.4 and using the standard library datetime. I am expecting the difference between two datetime.now to be zero. Instead I get a number like 86399. import datetime print((datetime.datetime.now() […]

python `(datetime.datetime.now() – datetime.datetime.now()).seconds` does not return 0 seconds [duplicate]

This question already has an answer here: Why does datetime.datetime.now() – datetime.datetime.now() equal to datetime.timedelta(-1, 86399, 999974)? (1 answer) Closed 1 hour ago. I’m working with python 3.12.4 and using the standard library datetime. I am expecting the difference between two datetime.now to be zero. Instead I get a number like 86399. import datetime print((datetime.datetime.now() […]

Converting time and then calculating duration

I am working in Python and I have a .csv file that I’ve imported with two columns: a start date and and end date. I need to be able to convert both dates to a readable format in python so that it can calculate how many days between the two days. So an example would be: