<?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: Text getting identified as DateTime instead of Time in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72872#M25477</link>
    <description>Hi Naman,&lt;BR /&gt;&lt;BR /&gt;It is bit tricky to Validate whether given string is time or not. However if you can implement same Choice logic inside a Code stage it will be very easy for you to find it out.&lt;BR /&gt;&lt;BR /&gt;Example C# Code for validating and storing it to respective data type&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="lang-cs s-code-block"&gt;&lt;CODE class="hljs language-csharp"&gt;TimeSpan.TryParse(input, &lt;SPAN class="hljs-keyword"&gt;out&lt;/SPAN&gt; timeOutput)   // For Time and TimeSpan parsing&lt;BR /&gt;int.TryParse(input, out intOutput)         // For number&lt;BR /&gt;DateTime.TryParse(input, out dateTimeOutput) // For DateTime&lt;BR /&gt;bool.TryParse(input, out flagOutput)        // For Flag&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Above code snippet will returns true if the input value is valid time/number/datetime/flag and stores time value to respective data item.&lt;BR /&gt;&lt;BR /&gt;Please do let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Srinivasa Tammineni&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Wed, 04 Aug 2021 21:11:00 GMT</pubDate>
    <dc:creator>SrinivasaTammin</dc:creator>
    <dc:date>2021-08-04T21:11:00Z</dc:date>
    <item>
      <title>Text getting identified as DateTime instead of Time</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72870#M25475</link>
      <description>I have a String(Text) which is formatted as Time but when I evaluate the expression, the text gets identified as DateTime. As no date is mentioned in the text, the present date(Today()) is added to it automatically.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17987.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/18140i583558C88166C393/image-size/large?v=v2&amp;amp;px=999" role="button" title="17987.png" alt="17987.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17988.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/18141i38E0F728F287E47B/image-size/large?v=v2&amp;amp;px=999" role="button" title="17988.png" alt="17988.png" /&gt;&lt;/span&gt;&lt;BR /&gt;For e.g. Text &lt;STRONG&gt;07:04:12&lt;/STRONG&gt; will get converted into &lt;STRONG&gt;04-08-2021&lt;/STRONG&gt; &lt;STRONG&gt;07:04:12&amp;nbsp;&lt;/STRONG&gt;if today is 04-08-2021 instead of Time &lt;STRONG&gt;07:04:12.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;What I really want is:&lt;/STRONG&gt;&lt;BR /&gt;Taking a&amp;nbsp;&lt;EM&gt;Text&lt;/EM&gt; and deciding whether that string is a Flag, Text, Number, DateTime, etc and storing that string to it's data item after type conversion.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Thanks,&lt;BR /&gt;Naman Chauhan&lt;BR /&gt;------------------------------</description>
      <pubDate>Wed, 04 Aug 2021 08:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72870#M25475</guid>
      <dc:creator>chauhannaman98</dc:creator>
      <dc:date>2021-08-04T08:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: Text getting identified as DateTime instead of Time</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72871#M25476</link>
      <description>Hi Naman,&lt;BR /&gt;&lt;BR /&gt;Since you are dealing with text datatype hence the blue prism is considering it as "DateTime" and is appending today's date. In order to solve the issue, please use conversion &lt;STRONG&gt;ToTime &lt;/STRONG&gt;method and then check if it's valid datetime. PFB the snippet for the same.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17981.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/18129i275302830A044E4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="17981.png" alt="17981.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ritansh Jatwani Senior Consultant&lt;BR /&gt;Consultant&lt;BR /&gt;EY&lt;BR /&gt;Gurgaon&lt;BR /&gt;*If you find this post helpful mark it as best answer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Aug 2021 09:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72871#M25476</guid>
      <dc:creator>ritansh.jatwani</dc:creator>
      <dc:date>2021-08-04T09:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: Text getting identified as DateTime instead of Time</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72872#M25477</link>
      <description>Hi Naman,&lt;BR /&gt;&lt;BR /&gt;It is bit tricky to Validate whether given string is time or not. However if you can implement same Choice logic inside a Code stage it will be very easy for you to find it out.&lt;BR /&gt;&lt;BR /&gt;Example C# Code for validating and storing it to respective data type&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="lang-cs s-code-block"&gt;&lt;CODE class="hljs language-csharp"&gt;TimeSpan.TryParse(input, &lt;SPAN class="hljs-keyword"&gt;out&lt;/SPAN&gt; timeOutput)   // For Time and TimeSpan parsing&lt;BR /&gt;int.TryParse(input, out intOutput)         // For number&lt;BR /&gt;DateTime.TryParse(input, out dateTimeOutput) // For DateTime&lt;BR /&gt;bool.TryParse(input, out flagOutput)        // For Flag&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Above code snippet will returns true if the input value is valid time/number/datetime/flag and stores time value to respective data item.&lt;BR /&gt;&lt;BR /&gt;Please do let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Srinivasa Tammineni&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Aug 2021 21:11:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Text-getting-identified-as-DateTime-instead-of-Time/m-p/72872#M25477</guid>
      <dc:creator>SrinivasaTammin</dc:creator>
      <dc:date>2021-08-04T21:11:00Z</dc:date>
    </item>
  </channel>
</rss>

