<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Convert a datetime Text to DateTime object</title><link>https://community.appian.com/discussions/f/rules/12976/convert-a-datetime-text-to-datetime-object</link><description>Hi, 
 Is there an OOTB function to convert a datetime text to DateTime object? 
 The datetime string is of the format - YYYY-MM-DDThh:mm:ss.SSSZ (Example: 2018-07-20T09:09:26.000Z) 
 
 TIA 
 Regards, 
 Sunil Zacharia</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/81093?ContentTypeID=1</link><pubDate>Wed, 21 Apr 2021 20:55:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:59e8ff7b-82e0-4294-a6eb-90d279979254</guid><dc:creator>Dylan Freadhoff</dc:creator><description>&lt;p&gt;Use the value function to parse text date into a date.&amp;nbsp; see&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/21.1/fnc_text_value.html"&gt;docs.appian.com/.../fnc_text_value.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/58459?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 13:37:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:88137c17-148b-485a-94dd-a8f41b302a30</guid><dc:creator>yeswanththiyarir</dc:creator><description>Great solution and smart work!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/58428?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 17:28:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bc7afe08-3fa5-4a73-88e2-d6375432e3f2</guid><dc:creator>chandu</dc:creator><description>Hi Sunil,&lt;br /&gt;
I just want to know what is your requirement. Are you using any service to get data from DB. I see that the Date Time text format is in converted Json format. if you are getting this type of format from service. In my perspective better to get the proper date time format from service so that we can reduce the calling the custom rule for Converting the date time text to Date time object for each of the date &amp;amp; time parameter&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/58410?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 07:09:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c7c720d0-35ca-471e-9623-3c7f520e29b8</guid><dc:creator>Sunil Zacharia</dc:creator><description>Thanks Mike.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/58399?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 19:31:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ea71e807-89dd-4df9-a498-d9dd94cdf706</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In the past I needed to do a much similar conversion - here&amp;#39;s the expression rule I used:&lt;/p&gt;
&lt;pre&gt;with(&lt;br /&gt;&amp;nbsp; local!dateTimeValueArray: split(substitute(substitute(substitute( ri!string,&amp;nbsp; &amp;quot; &amp;quot;, &amp;quot;:&amp;quot; ), &amp;quot;-&amp;quot;, &amp;quot;:&amp;quot;), &amp;quot;.&amp;quot;, &amp;quot;:&amp;quot;), &amp;quot;:&amp;quot;),&lt;br /&gt;&amp;nbsp; if(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rule!APN_isEmpty(local!dateTimeValueArray), &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null(),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; datetime(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local!dateTimeValueArray[1],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local!dateTimeValueArray[2],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local!dateTimeValueArray[3],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index(local!dateTimeValueArray, 4, 0),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index(local!dateTimeValueArray, 5, 0),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index(local!dateTimeValueArray, 6, 0),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index(local!dateTimeValueArray, 7, 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;&amp;nbsp; )&lt;br /&gt;)&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert a datetime Text to DateTime object</title><link>https://community.appian.com/thread/58384?ContentTypeID=1</link><pubDate>Thu, 26 Jul 2018 14:29:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2860fb88-5442-4391-bf0d-128619c54502</guid><dc:creator>Ashvin Kapur</dc:creator><description>&lt;p&gt;I would use the datetime function and split your datetime string so you have the necessary properties. That function will return a value of DateTime.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>