<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Alternatively using native in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89965#M40276</link>
    <description>Alternatively using native Blue Prism functionality:
Choice Stage
Choice - FormatDate(Today(), ""dddd"") = ""Saturday""
Calculation Stage if True - ToDateTime(AddDays(Now(), 2)) + MakeTimeSpan(0 ,[Hours], [Minutes], [Seconds])
Choice - FormatDate(Today(), ""dddd"") = ""Sunday""
Calculation Stage if True - ToDateTime(AddDays(Now(), 1)) + MakeTimeSpan(0 ,[Hours], [Minutes], [Seconds])
You can initialise the [Hours], [Minutes] and [Seconds] data items to 0, or provide based on time you want to defer until on Monday. Or alternatively hard code within calculation stage.
These calculation stage will then output to a DateTime data item that can be used as the input to your Defer action.</description>
    <pubDate>Sat, 22 Oct 2016 17:43:00 GMT</pubDate>
    <dc:creator>TomBlackburn1</dc:creator>
    <dc:date>2016-10-22T17:43:00Z</dc:date>
    <item>
      <title>How to get the next business working day's date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89963#M40274</link>
      <description>We have a business scenario, in the process, there is a decision point to check if variable Date's day is Saturday,  Sunday or public holiday , if yes, defer it to next Business Day(eg. Monday)

Does Blue Prism has the function to check the day of the week? 

Thank you</description>
      <pubDate>Fri, 21 Oct 2016 17:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89963#M40274</guid>
      <dc:creator>LuXu</dc:creator>
      <dc:date>2016-10-21T17:13:00Z</dc:date>
    </item>
    <item>
      <title>C# code implementation:</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89964#M40275</link>
      <description>C# code implementation:
Global Code:
public static DateTime GetNextWeekday(DateTime start, DayOfWeek day)
{
	int daysToAdd = ((int) day - (int) start.DayOfWeek + 7) % 7;
	return start.AddDays(daysToAdd);
}
public static bool IsDaylightSavings(String zoneID)
{
	DateTime dt = DateTime.Now;
	TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(zoneID);
	return tzi.IsDaylightSavingTime(dt);
}
Code Stage: (Inputs: addHours (Number) addMinutes (Number) addSeconds (Number))
DateTime date = DateTime.Today;
bool isDST = IsDaylightSavings(""GMT Standard Time"");
if(isDST) {
	TimeSpan span = new TimeSpan(0, 1 + Convert.ToInt32(addHours), Convert.ToInt32(addMinutes), Convert.ToInt32(addSeconds), 0);
	output = GetNextWeekday(date + span, DayOfWeek.Monday);
} else {
	TimeSpan span = new TimeSpan(0, Convert.ToInt32(addHours), Convert.ToInt32(addMinutes), Convert.ToInt32(addSeconds), 0);
	output = GetNextWeekday(date + span, DayOfWeek.Monday);
}
If I ran this form myself it would output 24/10/2016 00:00:00</description>
      <pubDate>Sat, 22 Oct 2016 17:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89964#M40275</guid>
      <dc:creator>TomBlackburn1</dc:creator>
      <dc:date>2016-10-22T17:00:00Z</dc:date>
    </item>
    <item>
      <title>Alternatively using native</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89965#M40276</link>
      <description>Alternatively using native Blue Prism functionality:
Choice Stage
Choice - FormatDate(Today(), ""dddd"") = ""Saturday""
Calculation Stage if True - ToDateTime(AddDays(Now(), 2)) + MakeTimeSpan(0 ,[Hours], [Minutes], [Seconds])
Choice - FormatDate(Today(), ""dddd"") = ""Sunday""
Calculation Stage if True - ToDateTime(AddDays(Now(), 1)) + MakeTimeSpan(0 ,[Hours], [Minutes], [Seconds])
You can initialise the [Hours], [Minutes] and [Seconds] data items to 0, or provide based on time you want to defer until on Monday. Or alternatively hard code within calculation stage.
These calculation stage will then output to a DateTime data item that can be used as the input to your Defer action.</description>
      <pubDate>Sat, 22 Oct 2016 17:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89965#M40276</guid>
      <dc:creator>TomBlackburn1</dc:creator>
      <dc:date>2016-10-22T17:43:00Z</dc:date>
    </item>
    <item>
      <title>The correct way to do this</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89966#M40277</link>
      <description>The correct way to do this would be to use the Blue Prism Internal - Calendars business object which contains lots of useful actions, especially for working day calculations that take bank holidays and weekends into account.
The object expects that you have a maintained calander in System Manager - which should be the case of you want to use the Blue Prism schedular within your organisation.
If you are ever finding yourself moving towards generating bespoke code to solve a problem like this I would strongly recommend asking your Blue Prism mentor or enablement manager first to ensure there is not something already provided with the product that solves your problem.</description>
      <pubDate>Mon, 24 Oct 2016 19:42:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-get-the-next-business-working-day-s-date/m-p/89966#M40277</guid>
      <dc:creator>Denis__Dennehy</dc:creator>
      <dc:date>2016-10-24T19:42:00Z</dc:date>
    </item>
  </channel>
</rss>

