Re: Compute working days

2021-08-18 Thread MRAB
On 2021-08-18 20:57, Bruno Lirio wrote: Em sábado, 14 de março de 2009 às 13:59:41 UTC-3, Casey escreveu: How about: from datetime import date, timedelta # Define the weekday mnemonics to match the date.weekday function (MON, TUE, WED, THU, FRI, SAT, SUN) = range(7) def workdays(start_date, end_

Re: Compute working days

2021-08-18 Thread Bruno Lirio
Em sábado, 14 de março de 2009 às 13:59:41 UTC-3, Casey escreveu: > How about: > from datetime import date, timedelta > # Define the weekday mnemonics to match the date.weekday function > (MON, TUE, WED, THU, FRI, SAT, SUN) = range(7) > def workdays(start_date, end_date, whichdays=(MON,TUE,WED,THU,

Re: Compute working days

2009-03-14 Thread Casey Webster
How about: from datetime import date, timedelta # Define the weekday mnemonics to match the date.weekday function (MON, TUE, WED, THU, FRI, SAT, SUN) = range(7) def workdays(start_date, end_date, whichdays=(MON,TUE,WED,THU,FRI)): ''' Calculate the number of working days between two dates

Re: Compute working days

2009-03-14 Thread John Machin
On Mar 15, 12:13 am, Gonsolo wrote: > I found no solution on the net so I am posting my solution here. > It can be called with "python cwd 1-1-2009 14-3-2009" > > from dateutil.rrule import * > from dateutil.parser import * > from datetime import * > from sys import * H ... I wonder what the

Compute working days

2009-03-14 Thread Gonsolo
I found no solution on the net so I am posting my solution here. It can be called with "python cwd 1-1-2009 14-3-2009" from dateutil.rrule import * from dateutil.parser import * from datetime import * from sys import * start = parse( argv[1] ) #end = datetime.now() end = parse( argv[2] ) workday