<?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 do I properly convert to UNIX time using strptime with this specific example? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429989#M122947</link>
    <description>&lt;P&gt;Ahh you're right, I missed that! Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 19:49:39 GMT</pubDate>
    <dc:creator>russell120</dc:creator>
    <dc:date>2018-12-12T19:49:39Z</dc:date>
    <item>
      <title>How do I properly convert to UNIX time using strptime with this specific example?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429987#M122945</link>
      <description>&lt;P&gt;The new &lt;CODE&gt;myTime&lt;/CODE&gt;field is blank for some reason -- anyone know why? Consider the below code I'm using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults
|eval originalTime = "01/05/19"
|eval myTime = strptime(originalTime, "%m/%d/%Y")
|table originalTime myTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Oddly enough, it DOES work if I use &lt;CODE&gt;|eval originalTime = "11:55"&lt;/CODE&gt; with &lt;CODE&gt;eval myTime = strptime(originalTime, "%H:%M")&lt;/CODE&gt;. Why won't my original query work? Because of this, I'm unable to convert time to UNIX time in my CSVs.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429987#M122945</guid>
      <dc:creator>russell120</dc:creator>
      <dc:date>2018-12-12T19:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I properly convert to UNIX time using strptime with this specific example?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429988#M122946</link>
      <description>&lt;P&gt;Your string format time is wrong. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults
 |eval originalTime = "01/05/19"
 |eval myTime = strptime(originalTime, "%m/%d/%y")
 |table originalTime myTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your upper case %Y is for year with century (i.e. 2019) . You specified without century (i.e. 19) which is %y&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429988#M122946</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-12-12T19:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I properly convert to UNIX time using strptime with this specific example?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429989#M122947</link>
      <description>&lt;P&gt;Ahh you're right, I missed that! Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429989#M122947</guid>
      <dc:creator>russell120</dc:creator>
      <dc:date>2018-12-12T19:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I properly convert to UNIX time using strptime with this specific example?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429990#M122948</link>
      <description>&lt;P&gt;It should be lowercase y in the format...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval originalTime = "01/05/19" 
| eval myTime=strptime(originalTime,"%m/%d/%y")
| table originalTime myTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With the strptime function, you must specify the time format of the string X so that the function can convert the string time into the correct UNIX time. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/DateandTimeFunctions#strptime.28X.2CY.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/DateandTimeFunctions#strptime.28X.2CY.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 19:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-properly-convert-to-UNIX-time-using-strptime-with-this/m-p/429990#M122948</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2018-12-12T19:49:58Z</dc:date>
    </item>
  </channel>
</rss>

