<?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: How to covert numbers into date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682588#M233185</link>
    <description>&lt;P&gt;Finally, the key piece of information! You are expecting this to be an Excel date value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval date=45123
| eval _time=(date-25567-2)*24*60*60&lt;/LI-CODE&gt;&lt;P&gt;Excel uses dates based on the start of the 20th Century 1900-01-01, counting in days, whereas, Splunk uses unix-style times based on seconds since 1970-01-01, so, you need to subtract the number of days between these two baseline points, and multiply by the number of seconds in a day. Note that Excel may not be calculating the date correctly since it indexes the first day as 1 (instead of 0) and incorrectly assumes that 1900 was a leap year (which it wasn't), hence the extra -2 days in the calculation.&lt;/P&gt;&lt;P&gt;Having said that, you will have to decide whether the _time value returned is correct based on the source of your data i.e. it could be a couple of days out.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2024 08:30:31 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-04-01T08:30:31Z</dc:date>
    <item>
      <title>How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682383#M233136</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a list of dates in the field called my_date like below:&lt;/P&gt;&lt;P data-unlink="true"&gt;45123&lt;BR /&gt;45127&lt;BR /&gt;45130&lt;/P&gt;&lt;P&gt;How can I convert this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 10:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682383#M233136</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-03-29T10:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682394#M233139</link>
      <description>&lt;P&gt;It depends on what this number is supposed to represent&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 14:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682394#M233139</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-29T14:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682540#M233167</link>
      <description>&lt;P&gt;I tried to convert it but i couldn't get the exact results. Are there any other ways to convert it&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (333).png" style="width: 362px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29978i0D7232FEF43B5056/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (333).png" alt="Screenshot (333).png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (334).png" style="width: 124px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29979iBEF04C21AEFB4711/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (334).png" alt="Screenshot (334).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 21:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682540#M233167</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-03-31T21:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682541#M233168</link>
      <description>&lt;P&gt;Again - what dates are these numbers supposed to be?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 21:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682541#M233168</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-31T21:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682544#M233170</link>
      <description>&lt;P&gt;It’s supposed to be based on the data&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 22:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682544#M233170</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-03-31T22:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682555#M233173</link>
      <description>&lt;P&gt;Can you give an example of what 45123 is supposed to be as a date? I can make a guess but it might be wrong which would waste everyone's time.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 06:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682555#M233173</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-01T06:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682564#M233174</link>
      <description>&lt;P&gt;Format of the date you want based on that number?&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682564#M233174</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-04-01T07:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682567#M233175</link>
      <description>&lt;P&gt;How about YYYY/mm/dd?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682567#M233175</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-01T07:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682569#M233176</link>
      <description>&lt;P&gt;Like this&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;YYYY-mm-dd&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682569#M233176</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-04-01T07:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682570#M233177</link>
      <description>&lt;P&gt;OK what date in YYYY-mm-dd format would you expect 45123 to be shown as?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:26:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682570#M233177</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-01T07:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682573#M233180</link>
      <description>&lt;P&gt;I’m not sure. Give me an example so that I can try that&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682573#M233180</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-04-01T07:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682574#M233181</link>
      <description>&lt;P&gt;If I give you a conversion, how will you know whether it is correct or not?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 07:34:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682574#M233181</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-01T07:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682585#M233184</link>
      <description>&lt;P&gt;I tried this query but it's showing something like this. But when i checked with an excel for this number 45123 - it's showing as 07/16/23.&amp;nbsp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screenshot (333).png" style="width: 362px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29991i99A19C8C69FD9381/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot (333).png" alt="Screenshot (333).png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screenshot (334).png" style="width: 124px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29992i0EDADD80585640CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot (334).png" alt="Screenshot (334).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 08:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682585#M233184</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-04-01T08:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682588#M233185</link>
      <description>&lt;P&gt;Finally, the key piece of information! You are expecting this to be an Excel date value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval date=45123
| eval _time=(date-25567-2)*24*60*60&lt;/LI-CODE&gt;&lt;P&gt;Excel uses dates based on the start of the 20th Century 1900-01-01, counting in days, whereas, Splunk uses unix-style times based on seconds since 1970-01-01, so, you need to subtract the number of days between these two baseline points, and multiply by the number of seconds in a day. Note that Excel may not be calculating the date correctly since it indexes the first day as 1 (instead of 0) and incorrectly assumes that 1900 was a leap year (which it wasn't), hence the extra -2 days in the calculation.&lt;/P&gt;&lt;P&gt;Having said that, you will have to decide whether the _time value returned is correct based on the source of your data i.e. it could be a couple of days out.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 08:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682588#M233185</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-01T08:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert numbers into date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682605#M233189</link>
      <description>&lt;P&gt;Ok Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 10:39:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-covert-numbers-into-date/m-p/682605#M233189</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-04-01T10:39:57Z</dc:date>
    </item>
  </channel>
</rss>

