<?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>Adding hours to datetime value</title><link>https://community.appian.com/discussions/f/general/17543/adding-hours-to-datetime-value</link><description>Hi, 
 
 I have a scenario where I am fetching data from a table and need to add 3 days to the date time field and display it in a grid column 
 Have tried the following: 
 . 
 . 
 . 
 a!textField( value: a!forEach( items: local!datasubset.data, expression</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Adding hours to datetime value</title><link>https://community.appian.com/thread/98543?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 13:19:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2224ca82-c634-4d2e-af80-b87496929b85</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.2/Function_Recipes.html#date/time-results"&gt;docs.appian.com/.../Function_Recipes.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding hours to datetime value</title><link>https://community.appian.com/thread/98542?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 12:57:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d7a702cd-6482-4deb-b13e-a9d6b0183699</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;now()+intervalds(0,1,0)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding hours to datetime value</title><link>https://community.appian.com/thread/98539?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 12:44:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f25e561e-be91-4a10-92f8-7f9751c0fa36</guid><dc:creator>kavitar5580</dc:creator><description>&lt;p&gt;I want to add 1 in time. Please suggest&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding hours to datetime value</title><link>https://community.appian.com/thread/69111?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 08:53:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8eebff94-dc1a-450a-8889-1e09db17953e</guid><dc:creator>apoorvam</dc:creator><description>&lt;p&gt;Thanks so much&amp;nbsp;&lt;a href="/members/sandeepd0003"&gt;sandeepd&lt;/a&gt;&amp;nbsp;, this works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding hours to datetime value</title><link>https://community.appian.com/thread/69110?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 08:18:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fdc93d43-9260-4dc9-ad90-7231b61724a7</guid><dc:creator>sandeepd</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/apoorvam0001"&gt;apoorvam&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Above, where you are adding 3?&lt;/p&gt;
&lt;p&gt;If it is a date time field, simply add 3 in it. Create expression, rather than using for each in a textField directly. and use it in grid&amp;#39;s a!textField().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Error you are getting because your one operand is of Any Type. It should be date and Time.&lt;/p&gt;
&lt;p&gt;I have tried adding 3 in ri!testDateTime&amp;nbsp; and it is working perfectly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Eg:&amp;nbsp;&amp;nbsp;ri!sampleDate + tointeger(3)&lt;/p&gt;
&lt;p&gt;Output :-&amp;nbsp;&lt;span&gt;9/1/2019 2:30 AM EST&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sandeep&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>