You have 15 business days (exclude weekends) to complete the task, what will be the 15thday?
from java.util import Calendar#Function definitiondef getNextBusinessDday(d, n ):cal = Calendar.getInstance();cal.setTime(d)loop=1while(loop<=n) :cal.add(cal.DATE, +1)if (cal.get(cal.DAY_OF_WEEK)) not in [cal.FRIDAY,cal.SATURDAY] :loop=loop+1vserial = loopcalculatedetc = cal.getTime()return calculatedetc#variables for inputd = mbo.getDate("changedate")n = 15#function call whereever you want in the same scriptgetNextBusinessDday(d,n)
No comments:
Post a Comment