<?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: Wrong date/time conversion from epoch in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190855#M19524</link>
    <description>&lt;P&gt;At this moment I only have the problem I mention first.&lt;BR /&gt;
I get a date value in epoch format. If I convert that on a website it gives the correct date (12-29-2014) but in splunk it is converted to "12-29-2015".&lt;BR /&gt;
I have no clue yet what causes that addition of a year. Maybe timezone or something but it goes correct for over 4000 records and goes wrong for 6. I am under the impression that it might have something to do with my data and probably not with splunk but I want to understand why.&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2015 14:30:51 GMT</pubDate>
    <dc:creator>tomschoute</dc:creator>
    <dc:date>2015-05-19T14:30:51Z</dc:date>
    <item>
      <title>Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190852#M19521</link>
      <description>&lt;P&gt;I get data from an SQL Server db via DB input (DB Connect v2) in my index.&lt;BR /&gt;
I have a date field in epoch format from the db that I use as timestamp field.&lt;/P&gt;

&lt;P&gt;When I search the index it seems like the date conversion is wrong sometimes. For instance see below result. &lt;/P&gt;

&lt;P&gt;Time&lt;BR /&gt;
5/12/15 4:56:47.000 PM&lt;BR /&gt;&lt;BR /&gt;
Event&lt;BR /&gt;
"12-29-2015 16:56:47" object_id=281487347683737, id=3947, status="COMPLETED", status_object_id=3094610094, created=1419868607970&lt;/P&gt;

&lt;P&gt;The column "created" comes from the database and should be converted. The date/time between quotes is the converted date which in this case has a wrong year (it should be 2014). The Time part is set to the time the data was loaded I think.&lt;/P&gt;

&lt;P&gt;To compare, another set of data gave below result:&lt;/P&gt;

&lt;P&gt;Time&lt;BR /&gt;
5/19/15 9:30:04.000 AM&lt;BR /&gt;&lt;BR /&gt;
Event&lt;BR /&gt;
"11-18-2009 09:30:04" object_id=281485922926681, id=32, status="CLOSED", status_object_id=3094610096, created=1258533004970&lt;/P&gt;

&lt;P&gt;The "created" datetime and the datetime it was converted to are the same (11-18-2009 09:30:04) but the "TIme" field is set to today. This Time field is used to create separate year, month, etc. fields which I want to use to create a chart on.&lt;/P&gt;

&lt;P&gt;There are also a lot of results that give the correct values, for example:&lt;/P&gt;

&lt;P&gt;Time&lt;BR /&gt;
11/5/14 11:22:58.000 AM &lt;BR /&gt;
Event&lt;BR /&gt;
"11-05-2014 11:22:58" object_id=281487302656167, id=3800, status="DISPATCHED", status_object_id=3120234513, created=1415182978970&lt;/P&gt;

&lt;P&gt;Does anyone has an idea what is going wrong here? How these wrong conversions can be avoided because they make the data unreliable.&lt;BR /&gt;
Or maybe explain how I can do it differently? To be clear: I want to make some charts on data from a database and I want to use a date field from the database to create counts per year, month and so on.&lt;/P&gt;

&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190852#M19521</guid>
      <dc:creator>tomschoute</dc:creator>
      <dc:date>2020-09-28T19:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190853#M19522</link>
      <description>&lt;P&gt;Hi tomschoute,&lt;/P&gt;

&lt;P&gt;maybe you should take a look at this:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/admin/Propsconf" target="_blank"&gt;props.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I think the MAX_DAYS_AGO parameter is the one you need.&lt;BR /&gt;
I had the same issue one time and it solved it for me.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190853#M19522</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2020-09-28T19:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190854#M19523</link>
      <description>&lt;P&gt;I'm confused as to what the problem is here.&lt;/P&gt;

&lt;P&gt;Your data, Splunk is picking up the created as being the timestamp.  The only issue you might have could be timezones, for example, BST might be adding + 1 hour.  &lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 14:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190854#M19523</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-05-19T14:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190855#M19524</link>
      <description>&lt;P&gt;At this moment I only have the problem I mention first.&lt;BR /&gt;
I get a date value in epoch format. If I convert that on a website it gives the correct date (12-29-2014) but in splunk it is converted to "12-29-2015".&lt;BR /&gt;
I have no clue yet what causes that addition of a year. Maybe timezone or something but it goes correct for over 4000 records and goes wrong for 6. I am under the impression that it might have something to do with my data and probably not with splunk but I want to understand why.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 14:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190855#M19524</guid>
      <dc:creator>tomschoute</dc:creator>
      <dc:date>2015-05-19T14:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190856#M19525</link>
      <description>&lt;P&gt;Regarding the wrong year I ran into this problem yesterday, I think it's a bug as it's assuming &lt;EM&gt;this&lt;/EM&gt; year for the timestamp and not &lt;EM&gt;last&lt;/EM&gt; year.&lt;/P&gt;

&lt;P&gt;Specifically:&lt;/P&gt;

&lt;P&gt;"&lt;EM&gt;2015&lt;/EM&gt;-12-30 13:57:30" timestamp=1419973050000&lt;/P&gt;

&lt;P&gt;Where timestamp converts:&lt;/P&gt;

&lt;P&gt;GMT: Tue, 30 Dec 2014 20:57:30 GMT&lt;BR /&gt;
Your time zone: 12/30/&lt;STRONG&gt;2014&lt;/STRONG&gt;, 1:57:30 PM GMT-7:00&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 19:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190856#M19525</guid>
      <dc:creator>jberd126</dc:creator>
      <dc:date>2015-05-20T19:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190857#M19526</link>
      <description>&lt;P&gt;&lt;STRONG&gt;UPDATE (workaround)&lt;/STRONG&gt;&lt;BR /&gt;
I have changed my Splunk DB Connect - DB Input to use 'epochtime' format as its conversion (rather than the default human readable format.)&lt;/P&gt;

&lt;P&gt;This problem then does not occur. This seems to be a reasonable workaround (for me at least).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Original Response&lt;/STRONG&gt;&lt;BR /&gt;
I've just had exactly the same problem... reading in data from 2011-2015, the ONLY date effected was 29th December 2014, where ALL epoch times for this date have been converted to have the year 2015.... &lt;/P&gt;

&lt;P&gt;I expect this is a problem with the "splunk db connect" app rather than splunk itself.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 15:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190857#M19526</guid>
      <dc:creator>henchrm</dc:creator>
      <dc:date>2015-11-24T15:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190858#M19527</link>
      <description>&lt;P&gt;I've done more investigation, and actually found that this happens on the last few days on each year within the data. My assumption therefore is that the splunk DB connect app is calculating the year incorrectly from the epoch format timestamp before indexing. (As the event string itself has the converted date, which is incorrect - and the splunk event time always matches this converted date).&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;Event Time&lt;BR /&gt;
31/12/2014&lt;BR /&gt;
15:18:27.000    &lt;/P&gt;

&lt;P&gt;Event Data&lt;BR /&gt;
"2014-12-31 15:18:27" CHANGEID=1770752, CHANGETS=1388503107000&lt;/P&gt;

&lt;P&gt;Where 1388503107000 &lt;EM&gt;should&lt;/EM&gt; be GMT: Tue, 31 Dec 2013 15:18:27 GMT&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 16:26:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190858#M19527</guid>
      <dc:creator>henchrm</dc:creator>
      <dc:date>2015-11-24T16:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong date/time conversion from epoch</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190859#M19528</link>
      <description>&lt;P&gt;I have changed my Splunk DB Connect - DB Input to use 'epochtime' format as its conversion (rather than the default human readable format.)&lt;/P&gt;

&lt;P&gt;This problem then does not occur. This seems to be a reasonable workaround (for me at least).&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 11:33:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Wrong-date-time-conversion-from-epoch/m-p/190859#M19528</guid>
      <dc:creator>henchrm</dc:creator>
      <dc:date>2015-11-30T11:33:35Z</dc:date>
    </item>
  </channel>
</rss>

