<?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 RE: Convert String to Date in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91572#M41556</link>
    <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/548"&gt;@MichealCharron&lt;/a&gt;, this makes more sense. Will try it on.&lt;BR /&gt;------------------------------&lt;BR /&gt;Dhenn Mark Espiritu&lt;BR /&gt;RPA Consultant&lt;BR /&gt;EY&lt;BR /&gt;Asia/Manila&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 27 Jun 2022 00:55:00 GMT</pubDate>
    <dc:creator>Dhenn_MarkEspir</dc:creator>
    <dc:date>2022-06-27T00:55:00Z</dc:date>
    <item>
      <title>Convert String to Date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91569#M41553</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there an easier way to convert a string to date format? For example the date string has 1st, 2nd, 3rd, 4th, 5th, 6th... 31st. of June&lt;BR /&gt;&lt;BR /&gt;Perhaps converting &lt;STRONG&gt;18th March 2021&lt;/STRONG&gt; to &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;18/03/2021&lt;/EM&gt;&lt;/SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dhenn Mark Espiritu&lt;BR /&gt;RPA Consultant&lt;BR /&gt;EY&lt;BR /&gt;Asia/Manila&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jun 2022 02:18:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91569#M41553</guid>
      <dc:creator>Dhenn_MarkEspir</dc:creator>
      <dc:date>2022-06-24T02:18:00Z</dc:date>
    </item>
    <item>
      <title>RE: Convert String to Date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91570#M41554</link>
      <description>&lt;P&gt;Hi Dhenn,&lt;BR /&gt;&lt;BR /&gt;For your requirement you can create a new business object called as &lt;STRONG&gt;'Date Time Manipulation (Advanced)'&lt;/STRONG&gt;. Provide the below Name Space Imports and External References in the Page Description stage of your &lt;STRONG&gt;Initialise&lt;/STRONG&gt; action keeping your language set up as '&lt;STRONG&gt;Visual Basic&lt;/STRONG&gt;' as shown below:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24296.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24429iE8EA13313496FF3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="24296.png" alt="24296.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Now you can create a new action called as '&lt;STRONG&gt;Parse Date&lt;/STRONG&gt;'. This action will have two input arguments:&lt;BR /&gt;&lt;BR /&gt;1) Input Date (Text): This is the required date string from where you want to generate a valid date data item.&lt;BR /&gt;2) Date Formats (Collection): This collection will have one column called as '&lt;STRONG&gt;Date Format&lt;/STRONG&gt;' which will comprise of all the possible date formats in each row which your input date string can have:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24297.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24434i4A1D12FD79BF707C/image-size/large?v=v2&amp;amp;px=999" role="button" title="24297.png" alt="24297.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24298.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24430iA11AA5C1B6C02E72/image-size/large?v=v2&amp;amp;px=999" role="button" title="24298.png" alt="24298.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Also, create two output arguments:&lt;BR /&gt;&lt;BR /&gt;1) Output Date (Date): This is the output date that will be generated from this given action.&lt;BR /&gt;2) Message (Text) : This will have the error message in case of any exception.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24299.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24435i81AC80DA03190AF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="24299.png" alt="24299.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Now add a code stage named 'Parse Date' as shown in the workflow and map the arguments as below and provide the same code as well:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24300.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24431i411CDD9F44AC9C07/image-size/large?v=v2&amp;amp;px=999" role="button" title="24300.png" alt="24300.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24301.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24432i94CE528CB118AFD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="24301.png" alt="24301.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24302.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24437iB71E12E464333DC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="24302.png" alt="24302.png" /&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;Dim temp_message As String
For Each format_item As DataRow In Date_Formats.Rows
	
	Try
	
		Output_Date = DateTime.ParseExact(Input_Date, format_item(0).ToString, System.Globalization.CultureInfo.InvariantCulture).Date
		Message = "Success"
		Exit For
	
	Catch Ex As Exception
		
		temp_message = format_item(0).ToString &amp;amp; " - " &amp;amp; ex.Message.ToString
		
		If Message.Equals("") Then

			Message = temp_message

		Else
	
			Message = Message &amp;amp; Environment.NewLine &amp;amp; temp_message
		
		End If

		Continue For

	End Try
	
Next
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;That's all and you are set now to publish this action and make the call from Process Studio.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Test Scenario:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Just make sure you pass the input date in the following format to this action: &lt;STRONG&gt;&lt;CODE&gt;12 March 2022&lt;/CODE&gt; &lt;BR /&gt;&lt;BR /&gt;So, if you input text has any date as 12th March 2022, ensure you remove the 'th', 'st' or the 'nd' portion first from your input string.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Before this action you can simply call a calculation stage and do this operation with the following expression:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24303.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24436iD9788183D0EC63FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="24303.png" alt="24303.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;Replace([Input Date],Mid([Input Date],1,InStr([Input Date], " ")-1),Replace(Replace(Replace(Mid([Input Date],1,InStr([Input Date], " ")-1),"th",""),"nd",""),"st",""))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Once you have the input in a format which can either be: &lt;CODE&gt;dd MMMM yyyyy or d MMMM yyyy&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;dd MMMM yyyy&lt;/CODE&gt; will be used for any date which can have two digits in the day place like 12 August 2022, 21 March 2022 etc.&lt;BR /&gt;&lt;CODE&gt;d MMMM yyyy&lt;/CODE&gt; will be used for any date which can have one digit in the day place like 1 January 2022, 9 December 2022 etc.&lt;BR /&gt;&lt;BR /&gt;Simply create a collection called as Date Formats with both these values:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24304.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24433iC0A761D3783785CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="24304.png" alt="24304.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;So now in the action, you simply pass the input date that we got from the calculation stage along with the date formats collection and you would get your output as shown below:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24305.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24439iCBEBB319AD2571EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="24305.png" alt="24305.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jun 2022 07:37:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91570#M41554</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-06-24T07:37:00Z</dc:date>
    </item>
    <item>
      <title>RE: Convert String to Date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91571#M41555</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="e26539f2-119a-4189-b3d1-6a7a6a3956e7" data-tag-text="@Dhenn Mark Espiritu" href="https://community.blueprism.com/network/profile?UserKey=e26539f2-119a-4189-b3d1-6a7a6a3956e7" data-itemmentionkey="59de9199-2cab-4689-a47f-dbc97d049313"&gt;@Dhenn Mark Espiritu&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You can use the "&lt;STRONG&gt;Regex Replace&lt;/STRONG&gt;" action in Blue Prism's "&lt;STRONG&gt;Utility - Strings&lt;/STRONG&gt;" VBO to rearrange the important parts of the string and then cast it directly into a "&lt;STRONG&gt;Date&lt;/STRONG&gt;"​ data item.&lt;BR /&gt;
&lt;TABLE style="width: 789px; height: 52px;"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 52px;"&gt;
&lt;TD style="width: 341.812px; height: 52px;"&gt;
&lt;DIV class="media" style="overflow: hidden; text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24306.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24438i147672029DDEED5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="24306.png" alt="24306.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD style="width: 446.188px; height: 52px;"&gt;
&lt;DIV class="media" style="overflow: hidden;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24307.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/24440iFDF6DB86A0738252/image-size/large?v=v2&amp;amp;px=999" role="button" title="24307.png" alt="24307.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;&lt;CODE&gt;"(\d+)\w{2}\s(\w+)\s(\d{4})"&lt;/CODE&gt;&lt;BR /&gt;The regular expression pattern captures:&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;The digits of the day (ignoring the suffix).&lt;/LI&gt;
&lt;LI&gt;The full month name.&lt;/LI&gt;
&lt;LI&gt;The four digits of the year.&lt;/LI&gt;
&lt;/OL&gt;
&lt;BR /&gt;&lt;CODE&gt;"$2 $1, $3"&lt;/CODE&gt;&lt;BR /&gt;The replacement string uses the capture positions to produce (&lt;CODE&gt;March 18, 2022&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;Capture 2 - The full month name.&lt;/LI&gt;
&lt;LI&gt;Capture 1 - The day (with a comma after it).&lt;/LI&gt;
&lt;LI&gt;Capture 3 - The four digits of the year.&lt;/LI&gt;
&lt;/OL&gt;
&lt;BR /&gt;The output of the action, although set as text, can cast directly into a "Date" data item.​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Micheal Charron&lt;BR /&gt;Senior Manager&lt;BR /&gt;RBC&lt;BR /&gt;America/Toronto&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jun 2022 13:22:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91571#M41555</guid>
      <dc:creator>MichealCharron</dc:creator>
      <dc:date>2022-06-24T13:22:00Z</dc:date>
    </item>
    <item>
      <title>RE: Convert String to Date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91572#M41556</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/548"&gt;@MichealCharron&lt;/a&gt;, this makes more sense. Will try it on.&lt;BR /&gt;------------------------------&lt;BR /&gt;Dhenn Mark Espiritu&lt;BR /&gt;RPA Consultant&lt;BR /&gt;EY&lt;BR /&gt;Asia/Manila&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jun 2022 00:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91572#M41556</guid>
      <dc:creator>Dhenn_MarkEspir</dc:creator>
      <dc:date>2022-06-27T00:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: Convert String to Date</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91573#M41557</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="e26539f2-119a-4189-b3d1-6a7a6a3956e7" data-tag-text="@Dhenn Mark Espiritu" href="https://community.blueprism.com/network/profile?UserKey=e26539f2-119a-4189-b3d1-6a7a6a3956e7" data-itemmentionkey="f0489a80-ec59-4ab1-8433-ed5d96c70462"&gt;@Dhenn Mark Espiritu&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You can find the "Regex Replace" action in the Blue Prism "Utility - Strings" VBO in the Blue Prism Digital Exchange.​&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---strings" target="_blank" rel="noopener"&gt;Blue Prism Digital Exchange - Utility - Strings&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Micheal Charron&lt;BR /&gt;Senior Manager&lt;BR /&gt;RBC&lt;BR /&gt;America/Toronto&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jun 2022 12:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Convert-String-to-Date/m-p/91573#M41557</guid>
      <dc:creator>MichealCharron</dc:creator>
      <dc:date>2022-06-27T12:32:00Z</dc:date>
    </item>
  </channel>
</rss>

