0

I need to determine the business day number of a specific date. For example, if I were to enter the date December 14, 2017, I need the output to be 10th business day (the day of the month excluding weekends and holidays). I also have a custom list of holidays that I would want to provide.

I'm sure I can figure this out doing the date math myself, but I was wondering if there's something already available in python that could handle this for me.

I've done some searching myself and found several questions about add and subtracting business days from a date, but not returning the business day number of a specific date.

Deena
  • 343
  • 1
  • 11
  • In addition you can just search for 'python (business OR work) days module'. Although I'm not sure if it's worth introducing a library just or this. – Thijs van Dien Dec 14 '17 at 18:28
  • @ThijsvanDien I'm not sure how that's a duplicate - it looks like that question is about adding/subtracting business days, which isn't exactly what I'm looking for. – Deena Dec 14 '17 at 18:31
  • 1
    It shows several ways of calculating the number of business days between two dates, with or without libraries, and in your case the first date is just the first of the month. – Thijs van Dien Dec 14 '17 at 18:35
  • Ah ok, I didn't make that connection. – Deena Dec 14 '17 at 18:37
  • I still think, however, that the cleanest option is to write it yourself, especially given the holiday requirement. – Thijs van Dien Dec 14 '17 at 18:39

0 Answers0