<?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: Convert seconds to MM:SS.ms in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85176#M21748</link>
    <description>&lt;P&gt;Did you mean strftime? Also, the latter will interpret timestr as # of seconds since the Unix epoch. While for times &amp;lt; 1 hour (3600 sec) it works just fine, when you start showing the hour, it may deliver confusing results (e.g. in my time zone, I get "16:00:05.12" for an input of "5.12").&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2013 12:44:31 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2013-10-07T12:44:31Z</dc:date>
    <item>
      <title>Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85174#M21746</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
I am trying to convert seconds.milliseconds for ex 4.6566, 0.55,1.2 to Minutes:Second.milliseconds format&lt;BR /&gt;
I tried tostring(time,duration) but it returns Days:hours:minutes:seconds&lt;BR /&gt;
Please help&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 11:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85174#M21746</guid>
      <dc:creator>splunk_learner</dc:creator>
      <dc:date>2013-10-07T11:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85175#M21747</link>
      <description>&lt;P&gt;Hi splunk_learner&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval n=strftime(timeStr, "%M:%S.%N")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This example returns the minute, seconds and subseconds from the timeStr field.&lt;BR /&gt;
See the docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Commontimeformatvariables"&gt;Commontimeformatvariables&lt;/A&gt; for more information on the time format.&lt;/P&gt;

&lt;P&gt;update:&lt;BR /&gt;&lt;BR /&gt;
just learned that &lt;CODE&gt;strptime&lt;/CODE&gt; is for time stamp &lt;STRONG&gt;parsing&lt;/STRONG&gt;, where &lt;CODE&gt;strftime&lt;/CODE&gt; is for time stamp &lt;STRONG&gt;formatting&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;hope this helps...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 12:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85175#M21747</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-10-07T12:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85176#M21748</link>
      <description>&lt;P&gt;Did you mean strftime? Also, the latter will interpret timestr as # of seconds since the Unix epoch. While for times &amp;lt; 1 hour (3600 sec) it works just fine, when you start showing the hour, it may deliver confusing results (e.g. in my time zone, I get "16:00:05.12" for an input of "5.12").&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 12:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85176#M21748</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-10-07T12:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85177#M21749</link>
      <description>&lt;P&gt;no strftime takes epochtime as input as were strptime takes a time represented by a string....but now after some testing it looks like strptime isn't working either &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 12:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85177#M21749</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-10-07T12:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85178#M21750</link>
      <description>&lt;P&gt;The OP indicated that they have seconds.milli and wanted a nice human-readable string. Sounds like they want strftime (with caveats).&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 13:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85178#M21750</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-10-07T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85179#M21751</link>
      <description>&lt;P&gt;a reverted convert mstime() would be the perfect match here&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 13:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85179#M21751</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-10-07T13:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert seconds to MM:SS.ms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85180#M21752</link>
      <description>&lt;P&gt;MuS was right there, just one change: Use strftime instead of strptime.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval test=4.678 | eval str=strftime(test,"%M:%S.%N")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;str returned as "00:04.678000000"&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 14:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-seconds-to-MM-SS-ms/m-p/85180#M21752</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2013-10-07T14:20:36Z</dc:date>
    </item>
  </channel>
</rss>

