<?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 Calculate number of days between two days in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505469#M33521</link>
    <description>&lt;P&gt;Hi! I am trying to get a duration of the project by calculation the number of days between today and the project submit date. They are both in the same format (mm/dd/yy), but there are no results.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval "Project Submit Date"=strftime(strptime(project_submit_date,"%Y-%m-%d %H:%M:%S"), "%m-%d-%y")&lt;BR /&gt;| eval today=strftime(now(), "%m-%d-%y")&lt;BR /&gt;| eval "Duration"=(today-'Project Submit Date')/86400&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 11:56:57 GMT</pubDate>
    <dc:creator>yvassilyeva</dc:creator>
    <dc:date>2020-06-22T11:56:57Z</dc:date>
    <item>
      <title>Calculate number of days between two days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505469#M33521</link>
      <description>&lt;P&gt;Hi! I am trying to get a duration of the project by calculation the number of days between today and the project submit date. They are both in the same format (mm/dd/yy), but there are no results.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval "Project Submit Date"=strftime(strptime(project_submit_date,"%Y-%m-%d %H:%M:%S"), "%m-%d-%y")&lt;BR /&gt;| eval today=strftime(now(), "%m-%d-%y")&lt;BR /&gt;| eval "Duration"=(today-'Project Submit Date')/86400&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 11:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505469#M33521</guid>
      <dc:creator>yvassilyeva</dc:creator>
      <dc:date>2020-06-22T11:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate number of days between two days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505474#M33522</link>
      <description>&lt;P&gt;The problem is you are converting an epoch time back into text before performing your delta between the two dates when you do a strftime after the strptime.&amp;nbsp; You can actually just use one eval to accomplish what you are looking for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| eval "Duration"=round(abs((relative_time(now(), "@d")-relative_time(strptime(project_submit_date,"%Y-%m-%d %H:%M:%S"), "@d"))/86400),0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 12:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505474#M33522</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2020-06-22T12:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate number of days between two days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505478#M33523</link>
      <description>&lt;P class="lia-align-justify"&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 12:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-number-of-days-between-two-days/m-p/505478#M33523</guid>
      <dc:creator>yvassilyeva</dc:creator>
      <dc:date>2020-06-22T12:24:29Z</dc:date>
    </item>
  </channel>
</rss>

