Posted: 24 Jul 2017 18:53 EDT Last activity: 16 Oct 2018 12:03 EDT
add days to datetime property using business days
I would like to add days to a datetime using only business days. The function DateTime.addToDate add a number to a date but doesn't use only business days.Are there any functions that add number to a datetime using only business days?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Business days is not a standard defined set of days and may vary depending on place, organization and on other factors. There may also be holidays which will not be considered as a business day thus the definition is dynamic in nature.
I am assuming you are referring to Mon-Fri weekdays by business days. You may thus have to write a custom function to achieve this.
I am trying to use Calendar rule to calculate days which will cover Monday to Friday and Holidays too. I have found 2 functions also but somehow those I am not able to provide because of error "rule instance not found".
pxAddTime and TimeDifferenceBusinessDays are those 2 functions.
Thanks a lot for the response, I am aware of those functions but my requirement is bit different.
The function differencebetweendatetimes gives the difference in seconds based on the business calendar and business hours.
But my requirement is something like below.
My Start Date is 20170908T102818.445 GMT and End Dtate is 20170911T102818.445 GMT i should get the difference by excluding sunday and saturday alone that means i should get the difference as 1 day. But the above function differencebetweendatetimes is giving output as
For example when i am using as @differenceBetweenDateTimes("20170911T222818.445 GMT","20170911T212818.445 GMT",true,"") i am getting the difference as 0 seconds but it should return the value as 360 Seconds ie 1 hour
I got the issue resolved, actually when we use @differenceBetweenDateTimes(Param.StartTime,Param.EndTime,True,"");
when the calendar parameter is blank it takes the Calendar as Default, Default calendar is an instance so i have saved as the default calendar instance, earlier the time was mentioned as 08000 to 170000 that the reason it was giving as 9 hours range i have changed that to whole day as working so now gives result in 24 hours range.