<?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>Fetching past date and time</title><link>https://community.appian.com/discussions/f/rules/12674/fetching-past-date-and-time</link><description>I want to fetch all the requests from the past one hour. This needs to be calculated from the current time. 
 
 I am using now() but stuck on how to subtract one hour from now. 
 
 TIA!!!</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Fetching past date and time</title><link>https://community.appian.com/thread/56639?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 09:47:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d486b7e-d140-4e75-b5d8-354ca075134f</guid><dc:creator>Sidhant Behura</dc:creator><description>You can use intervalds, which returns you duration and then you can deduct that duration from now().&lt;br /&gt;
Example: now()-intervalds(1,0,0) &lt;br /&gt;
&lt;br /&gt;
Or you can do it in a crude way i.e. by finding the decimal value of 1 hour in a day.&lt;br /&gt;
1 hour in Day is 0.0416667.&lt;br /&gt;
So if you substract 0.0416667 you will get 1 hour less than the current time.&lt;br /&gt;
&lt;br /&gt;
Example : now() - 0.0416667&lt;br /&gt;
&lt;br /&gt;
Please let me know if it helped.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fetching past date and time</title><link>https://community.appian.com/thread/56637?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 09:32:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:783ab80f-36a8-4578-b9b4-e05dfbea8e63</guid><dc:creator>arikd398</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&amp;nbsp;,&lt;br /&gt; &lt;br /&gt; You can try the below approach as well.&lt;br /&gt; &lt;br /&gt; datetime( year(now()),month(now()),day(now()),hour(now()),minute(now())-60) or&lt;/p&gt;
&lt;p&gt;datetime( year(now()),month(now()),day(now()),hour(now())-1,minute(now()))&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; You can use this logic for past year, month,day as well.&lt;br /&gt; &lt;br /&gt; date( year(now())-1,month(now()),day(now()))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fetching past date and time</title><link>https://community.appian.com/thread/56635?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 09:30:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1e530dc-c243-432d-a819-ee967819787e</guid><dc:creator>gurdeeps</dc:creator><description>Hi , are you trying to fetch it from Db?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fetching past date and time</title><link>https://community.appian.com/thread/56634?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 09:28:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04e744b5-071c-4c1a-9cfd-eded01372307</guid><dc:creator>Abhay Giri</dc:creator><description>Hi, &lt;br /&gt;
you can use below :&lt;br /&gt;
&lt;br /&gt;
time(hour(now())-1,minute(now()),second(now()))&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Abhay&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fetching past date and time</title><link>https://community.appian.com/thread/56633?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 09:25:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9c084ded-b184-445e-a830-6ceaa9024343</guid><dc:creator>soujanyac0001</dc:creator><description>Hi Vinitha,&lt;br /&gt;
&lt;br /&gt;
Try this once&lt;br /&gt;
&lt;br /&gt;
now()- intervalds(1,0,0)&lt;br /&gt;
&lt;br /&gt;
This funtion subtracts 1 hour from current time&lt;br /&gt;
&lt;br /&gt;
Hope this helps&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>