<?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 How come strptime does not work for some days? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-come-strptime-does-not-work-for-some-days/m-p/453363#M128319</link>
    <description>&lt;P&gt;There seems to be some issue with the strptime function. I'm not sure why it works for few days and does not work for few days.&lt;/P&gt;

&lt;P&gt;works &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| eval Disconnect_Time="02/05/2019 08:22:40" 
| eval last_updated_date_epoch=strptime(Disconnect_Time,"%d/%m/%Y %H:%M:%S") 
| eval now=now() 
| eval diff=last_updated_date_epoch-now() 
| eval duration=diff/3600/24 
| table Disconnect_Time,last_updated_date_epoch,now,diff,duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does not work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| eval Disconnect_Time="02/13/2019 08:22:40" 
| eval last_updated_date_epoch=strptime(Disconnect_Time,"%d/%m/%Y %H:%M:%S") 
| eval now=now() 
| eval diff=last_updated_date_epoch-now() 
| eval duration=diff/3600/24 
| table Disconnect_Time,last_updated_date_epoch,now,diff,duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Mar 2019 15:13:54 GMT</pubDate>
    <dc:creator>shaileshmali</dc:creator>
    <dc:date>2019-03-22T15:13:54Z</dc:date>
    <item>
      <title>How come strptime does not work for some days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-come-strptime-does-not-work-for-some-days/m-p/453363#M128319</link>
      <description>&lt;P&gt;There seems to be some issue with the strptime function. I'm not sure why it works for few days and does not work for few days.&lt;/P&gt;

&lt;P&gt;works &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| eval Disconnect_Time="02/05/2019 08:22:40" 
| eval last_updated_date_epoch=strptime(Disconnect_Time,"%d/%m/%Y %H:%M:%S") 
| eval now=now() 
| eval diff=last_updated_date_epoch-now() 
| eval duration=diff/3600/24 
| table Disconnect_Time,last_updated_date_epoch,now,diff,duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does not work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| eval Disconnect_Time="02/13/2019 08:22:40" 
| eval last_updated_date_epoch=strptime(Disconnect_Time,"%d/%m/%Y %H:%M:%S") 
| eval now=now() 
| eval diff=last_updated_date_epoch-now() 
| eval duration=diff/3600/24 
| table Disconnect_Time,last_updated_date_epoch,now,diff,duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Mar 2019 15:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-come-strptime-does-not-work-for-some-days/m-p/453363#M128319</guid>
      <dc:creator>shaileshmali</dc:creator>
      <dc:date>2019-03-22T15:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How come strptime does not work for some days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-come-strptime-does-not-work-for-some-days/m-p/453364#M128320</link>
      <description>&lt;P&gt;Because 13 is not a valid month number &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Think you need to swap the %d and %m in your time format &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 15:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-come-strptime-does-not-work-for-some-days/m-p/453364#M128320</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-03-22T15:16:10Z</dc:date>
    </item>
  </channel>
</rss>

