<?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: Timezone conversion function. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606099#M105325</link>
    <description>&lt;P&gt;Mmm...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1658213913001.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20577i10C8BA9A45F4FF9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1658213913001.png" alt="bowesmana_0-1658213913001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2022 06:58:44 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-07-19T06:58:44Z</dc:date>
    <item>
      <title>Is there any timezone conversion function in splunk to convert timezone in search string?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141159#M28906</link>
      <description>&lt;P&gt;Is there any timezone conversion function in splunk to convert timezone in search string?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 14:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141159#M28906</guid>
      <dc:creator>AditiKulkarni</dc:creator>
      <dc:date>2022-07-19T14:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141160#M28907</link>
      <description>&lt;P&gt;The 2 functions are &lt;CODE&gt;strptime&lt;/CODE&gt; and &lt;CODE&gt;strftime&lt;/CODE&gt;.  Here is an example string to convert &lt;CODE&gt;_time&lt;/CODE&gt; (which is stored as &lt;CODE&gt;UTC&lt;/CODE&gt;) to &lt;CODE&gt;EST&lt;/CODE&gt; within a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... |  eval EST_time=strptime(strftime(_time,"%m/%d/%Y %H:%M:%S EST"),"%m/%d/%Y %H:%M:%S %Z") | eval date_month=strftime(EST_time,"%m") | eval date_mday=strftime(EST_time,"%d") | eval date_hour=strftime(EST_time,"%H")| stats count by date_month,date_mday,date_hour | sort count desc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2015 04:21:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141160#M28907</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-29T04:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141161#M28908</link>
      <description>&lt;P&gt;I downvoted this post because this is not correct. this query says "pretend this utc date is actually a est date" which will &lt;EM&gt;add&lt;/EM&gt; 5 hours (rather than subtract). what you want is to say "given this utc date, what would it be in est time"? this is not possible to do simply in splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 03:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141161#M28908</guid>
      <dc:creator>rocketboots_ser</dc:creator>
      <dc:date>2016-10-12T03:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141162#M28909</link>
      <description>&lt;P&gt;Try this answer: &lt;A href="https://answers.splunk.com/answering/224136/view.html"&gt;https://answers.splunk.com/answering/224136/view.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 03:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141162#M28909</guid>
      <dc:creator>rocketboots_ser</dc:creator>
      <dc:date>2016-10-12T03:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141163#M28910</link>
      <description>&lt;P&gt;Inspired by the excellent answers provided &lt;A href="https://answers.splunk.com/answers/224134/force-displayed-timezone-in-results-to-be-utc-not-1.html"&gt;here&lt;/A&gt;, it is possible to convert to an arbitrary timezone provided that timezone always has a fixed UTC offset (i.e. does not support day light savings time).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval _timezone = "AEST"
| eval _time_AEST = _time 
    - (strptime("2000-01-01 +00:00", "%F %:z") - strptime("2000-01-01 " . strftime(_time, "%:z"), "%F %Z"))
    + (strptime("2000-01-01 +00:00", "%F %:z") - strptime("2000-01-01 " . _timezone, "%F %Z"))
| eval time_in_AEST = strftime(_time_AEST, "%F %T " . _timezone)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above works by first subtracting the UTC offset of the timezone as configured in the users preferences, then adds on the UTC offset of the timezone you configure (in this example &lt;CODE&gt;AEST&lt;/CODE&gt;, but could be &lt;CODE&gt;-05:30&lt;/CODE&gt; or any valid Splunk timezone identifier). The UTC offset of the two timezones in question is calculated by using a reference date (I chose 2000-01-01 arbitrarily) and parsing it twice, first using the UTC timezone and then the queried timezone, and the difference of the two yields the timezone offset.&lt;/P&gt;

&lt;P&gt;A couple of things to remember:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;in the example, Splunk interprets the &lt;CODE&gt;_time_AEST&lt;/CODE&gt; variable as seconds since epoch (1970-01-01 00:00:00 UTC), and so technically Splunk is interpreting this as a different 'real world' time -- if you attempt to print the timezone of the date, it will incorrectly report the users configured timezone. Instead, whenever printing this date always include the timezone manually and don't use the &lt;CODE&gt;%Z&lt;/CODE&gt; timezone formats (as is done in the last line of the example).&lt;/LI&gt;
&lt;LI&gt;I discovered that Splunk Light Version 6.4.1.2 seems to have a bug where it ignores the users timezone and always reports UTC. Using the above method will not break under such circumstances.&lt;/LI&gt;
&lt;LI&gt;The above can easily be converted to a macro. However I have found that when passing arguments to a macro it is best to use pre-calculated fields, rather than expressions (since expressions will have their &lt;CODE&gt;"&lt;/CODE&gt; quotes stripped when passed as arguments to a macro).&lt;/LI&gt;
&lt;LI&gt;Splunk does not seem to support the tz database - it only seems to support timezones with a fixed offset from UTC. For example, if you live in Sydney you would usually select the "Australia/Sydney" timezone from timezone dropdowns - however this item is not available in Splunks list of timezones in the user preferences. I believe this is because Sydney adheres to Day Light Savings time. If you wish to run a query using local time of an area which is not always a fixed offset from UTC, then you will have to upload a timestamp to Splunk in local time (of course this only applies if you are in control of your input sources) and not have Splunk interpret it (i.e. use a different field other than the &lt;CODE&gt;_time&lt;/CODE&gt; property). For our use case, we are uploading the 'real world time' using time since Epoch (assigned to the &lt;CODE&gt;_time&lt;/CODE&gt; property), and additionally upload a &lt;CODE&gt;timestamp&lt;/CODE&gt; field formatted as a date in local time which Splunk interpets as a string. This gives Splunk enough information to assign the correct time to the event, but also allows us to run queries against the local time where the data is sourced from.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 14 Oct 2016 00:27:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141163#M28910</guid>
      <dc:creator>rocketboots_ser</dc:creator>
      <dc:date>2016-10-14T00:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141164#M28911</link>
      <description>&lt;P&gt;I don't know to what you are referring to, but the answer by @woodcock seems like a fine example of a potential solution to the question as asked.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 01:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141164#M28911</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-10-14T01:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141165#M28912</link>
      <description>&lt;P&gt;I don't mind a downvote when I am actually wrong but he has in no way explained that I am.  I stand by my answer as-is.  Thanks for double-checking @rich7177.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 15:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141165#M28912</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-10-14T15:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141166#M28913</link>
      <description>&lt;P&gt;Hi @rocketboots_services&lt;/P&gt;

&lt;P&gt;Downvoting users' answers/comments in this forum should be reserved for suggestions that could potentially do harm to someone's environment. People are just trying to help each other out and learn. Simply commenting on @woodcock's answer would have sufficed. Please review how voting etiquette works on Splunk Answers for providing positive, constructive engagement within the community:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/244111/proper-etiquette-and-timing-for-voting-here-on-ans.html"&gt;https://answers.splunk.com/answers/244111/proper-etiquette-and-timing-for-voting-here-on-ans.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 16:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141166#M28913</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-10-14T16:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141167#M28914</link>
      <description>&lt;P&gt;Hi @rock7177 and @woodcock, thank you for pointing out that my comment was not fully explained. Apologies for incorrectly using down vote, it will not happen again (unfortunately I can't remove the vote now - "Sorry, but you can't cancel a vote after more than 1 day").&lt;/P&gt;

&lt;P&gt;There are two problems with the provided answer: it converts not from UTC to EST, but instead from EST to UTC (the wrong direction), and it does not take the timezone configured in the users preferences into account. An example follows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | head 1 
| eval time_in = strptime("2016-10-17 00:00:00 UTC", "%F %T %Z")
| eval time_adjusted = strptime(strftime(time_in,"%F %T EST"),"%F %T %Z")
| eval time_in_printed = strftime(time_in, "%F %T %Z")
| eval time_adjusted_printed = strftime(time_adjusted, "%F %T EST")
| table time_in_printed, time_adjusted_printed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Assuming my user preferences are set to UTC timezone, then I get the following results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_in_printed time_adjusted_printed
2016-10-17 00:00:00 UTC 2016-10-17 05:00:00 EST
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is incorrect. The correct answer would be &lt;CODE&gt;2016-10-16 19:00:00 EST&lt;/CODE&gt;, see &lt;A href="https://savvytime.com/converter/utc-to-est/00-00"&gt;https://savvytime.com/converter/utc-to-est/00-00&lt;/A&gt;. The problem is that it is &lt;EM&gt;replacing&lt;/EM&gt; the timezone information (+00:00) with EST (-05:00), rather than &lt;EM&gt;converting&lt;/EM&gt; it. However, if my timezone is set to +10:00 Brisbane:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_in_printed time_adjusted_printed
2016-10-17 10:00:00 AEST    2016-10-18 01:00:00 EST
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is a different but also incorrect answer. This is because the conversion method does not account for the timezone adjustment caused by updating the user preferences to anything other than UTC.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 00:01:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141167#M28914</guid>
      <dc:creator>rocketboots_ser</dc:creator>
      <dc:date>2016-10-17T00:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141168#M28915</link>
      <description>&lt;P&gt;I revisited this and came up with this complete question and answer:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/590067/how-do-i-map-my-personally-tz-adjusted-time-to-ano.html#answer-590068"&gt;https://answers.splunk.com/answers/590067/how-do-i-map-my-personally-tz-adjusted-time-to-ano.html#answer-590068&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 02:12:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141168#M28915</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-11-25T02:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141169#M28916</link>
      <description>&lt;P&gt;I revisited this and came up with this complete question and answer:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/590067/how-do-i-map-my-personally-tz-adjusted-time-to-ano.html#answer-590068"&gt;https://answers.splunk.com/answers/590067/how-do-i-map-my-personally-tz-adjusted-time-to-ano.html#answer-590068&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 02:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141169#M28916</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-11-25T02:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141170#M28917</link>
      <description>&lt;P&gt;Improving on the answer above, here is a version that DOES account for daylight savings timezones, as well as times with microseconds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval t=strptime("2017-01-01 14:00", "%F %H:%M"),
  from_tz="UTC",
  to_tz="Australia/Melbourne",
  from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),
  to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),
  offset=round((from_t-to_t)/60/60),
  converted=strftime(t + (from_t-to_t), "%c")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It can be simplified for brevity, I've just broken it into different variables to make it easier to follow. Also the offset variable is unused, but is just there so you can experiment by changing dates and timezones to see that the offset does actually change depending on whether daylight savings is applicable for the date. Note that if you put in explicit DST timezone names like 'AEDT' then it will ALWAYS be daylight savings, regardless of the date. But other timezone names (like Australia/Melbourne used in the example), which are sometimes DST and sometimes not, will change offset according to the input date. The list of timezone names appear to be the standard list from Java.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 03:22:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141170#M28917</guid>
      <dc:creator>EvilPuppetMaste</dc:creator>
      <dc:date>2018-01-19T03:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141171#M28918</link>
      <description>&lt;P&gt;This is a perfect solution. I modified it slightly for my use case, which is to ensure that the user's timezone matches the timezone of the source data. So the from_tz is done this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;from_tz=strftime(now(),"%Z")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 19:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141171#M28918</guid>
      <dc:creator>jlemley</dc:creator>
      <dc:date>2019-04-24T19:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141172#M28919</link>
      <description>&lt;P&gt;Thanks. This seems to be working great. However, only one issue of DayLight Savings. When converting from EDT to Asia/Shanghai timezone, i get offset of 12 which should be 13 depending on time of the year. any idea how to fix this issue ?&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 13:13:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141172#M28919</guid>
      <dc:creator>Nam7Splnk</dc:creator>
      <dc:date>2019-05-09T13:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141173#M28920</link>
      <description>&lt;P&gt;Try using America/New_York for the origin timezone. This should automatically convert between EDT and EST. &lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 12:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/141173#M28920</guid>
      <dc:creator>jlemley</dc:creator>
      <dc:date>2019-05-11T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606082#M105324</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/90813"&gt;@EvilPuppetMaste&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Improving on the answer above, here is a version that DOES account for daylight savings timezones, as well as times with microseconds:&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval t=strptime("2017-01-01 14:00", "%F %H:%M"),
  from_tz="UTC",
  to_tz="Australia/Melbourne",
  from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),
  to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),
  offset=round((from_t-to_t)/60/60),
  converted=strftime(t + (from_t-to_t), "%c")&lt;/PRE&gt;&lt;P&gt;It can be simplified for brevity, I've just broken it into different variables to make it easier to follow. Also the offset variable is unused, but is just there so you can experiment by changing dates and timezones to see that the offset does actually change depending on whether daylight savings is applicable for the date. Note that if you put in explicit DST timezone names like 'AEDT' then it will ALWAYS be daylight savings, regardless of the date. But other timezone names (like Australia/Melbourne used in the example), which are sometimes DST and sometimes not, will change offset according to the input date. The list of timezone names appear to be the standard list from Java.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This solution is incorrect.&lt;/P&gt;&lt;P&gt;Try below, convert 2022-11-06 01:10 US/Eastern and&amp;nbsp;2022-11-06 02:10 US/Eastern to Australia/Sydney time, you get&amp;nbsp;2022-11-06 15:10(Incorrect) and 2022-11-06 18:10(Correct) Sydney time respectively.&lt;/P&gt;&lt;P&gt;The way to calculate the two time zone's time gap is incorrect:&lt;/P&gt;&lt;P&gt;It assumes the gap is 2022-11-06 01:10 US/Eastern and&amp;nbsp;2022-11:06 01:10 Australia/Sydney.&lt;/P&gt;&lt;P&gt;When it approaches to the clock change hour(i.e. 2022-11-06 02:00 AM) the error happens&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults | eval t=strptime("2022-11-06 01:10", "%F %H:%M"),&lt;BR /&gt;from_tz="US/Eastern",&lt;BR /&gt;to_tz="Australia/Sydney",&lt;BR /&gt;from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),&lt;BR /&gt;to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),&lt;BR /&gt;offset=round((from_t-to_t)/60/60),&lt;BR /&gt;converted=strftime(t + (from_t-to_t), "%Y-%m-%d %H:%M")&lt;BR /&gt;| append [| makeresults | eval t=strptime("2022-11-06 02:10", "%F %H:%M"),&lt;BR /&gt;from_tz="US/Eastern",&lt;BR /&gt;to_tz="Australia/Sydney",&lt;BR /&gt;from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),&lt;BR /&gt;to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),&lt;BR /&gt;offset=round((from_t-to_t)/60/60),&lt;BR /&gt;converted=strftime(t + (from_t-to_t), "%Y-%m-%d %H:%M") ]&lt;BR /&gt;| fields converted, from_tz, to_tz | table converted, from_tz, to_tz&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 04:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606082#M105324</guid>
      <dc:creator>Ginger_chacha</dc:creator>
      <dc:date>2022-07-19T04:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606099#M105325</link>
      <description>&lt;P&gt;Mmm...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1658213913001.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20577i10C8BA9A45F4FF9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1658213913001.png" alt="bowesmana_0-1658213913001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 06:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606099#M105325</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-07-19T06:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606707#M105390</link>
      <description>&lt;P&gt;My profile is US/Eastern TZ based.&lt;/P&gt;&lt;P&gt;I checked for every hour from 2022-01-01 to 2023-01-01 for a few TZs, to ensure all clock changes are covered&lt;/P&gt;&lt;P&gt;1. Most of the MET&amp;lt;-&amp;gt;US/Eastern conversion is incorrect&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval t0="2022-04-12 04:04", t=strptime(t0, "%F %H:%M"),
from_tz="MET",
to_tz="US/Eastern"
| eval from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),
to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),
offset=round((from_t-to_t)/60/60),
converted=strftime(t + (from_t-to_t), "%Y-%m-%d %H:%M")
| append [makeresults| eval t0="2022-04-12 04:04", t=strptime("2022-04-12 04:04", "%F %H:%M"),
to_tz="MET",
from_tz="US/Eastern"
| eval
from_t=strptime(strftime(t, "%c.%6N " . from_tz), "%c.%6N %Z"),
to_t=strptime(strftime(t, "%c.%6N " . to_tz), "%c.%6N %Z"),
offset=round((from_t-to_t)/60/60),
converted=strftime(t + (from_t-to_t), "%Y-%m-%d %H:%M") ]
| table t0, converted, from_tz, to_tz&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actual Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="T1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20635iB9E2D5B933CED339/image-size/large?v=v2&amp;amp;px=999" role="button" title="T1.PNG" alt="T1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Expected Result:&lt;/P&gt;&lt;P&gt;2022-04-12 04:04 MET =&amp;nbsp;2022-04-11 22:04:00 US/Eastern&lt;BR /&gt;2022-04-12 04:04 US/Eastern =&amp;nbsp;2022-04-12 10:04:00 MET&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the total count:&amp;nbsp;5209 results of&amp;nbsp;8761 tests were incorrect, compared with the Python converted one.&lt;/P&gt;&lt;P&gt;8761 = 24 * 365 + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. From other regions to US/Eastern, one year there's one hour incorrect&lt;/P&gt;&lt;P&gt;Other regions tested:&lt;/P&gt;&lt;P&gt;Asia/Seoul, Australia/Sydney,Europe/London,Europe/Paris,GB-Eire,GMT,Japan&lt;/P&gt;&lt;TABLE width="702"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="234"&gt;from&lt;/TD&gt;&lt;TD width="234"&gt;python_to&lt;/TD&gt;&lt;TD width="234"&gt;splunk_to&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 GB-Eire&lt;/TD&gt;&lt;TD&gt;2022-03-12 21:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 22:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 GMT&lt;/TD&gt;&lt;TD&gt;2022-03-12 21:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 22:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 Japan&lt;/TD&gt;&lt;TD&gt;2022-03-12 12:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 13:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 Asia/Seoul&lt;/TD&gt;&lt;TD&gt;2022-03-12 12:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 13:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 Europe/London&lt;/TD&gt;&lt;TD&gt;2022-03-12 21:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 22:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 Australia/Sydney&lt;/TD&gt;&lt;TD&gt;2022-03-12 10:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 11:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-03-13 02:03:00 Europe/Paris&lt;/TD&gt;&lt;TD&gt;2022-03-12 20:03:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-03-12 21:03:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-04-03 02:04:00 Australia/Sydney&lt;/TD&gt;&lt;TD&gt;2022-04-02 11:04:00 US/Eastern&lt;/TD&gt;&lt;TD&gt;2022-04-02 12:04:00 US/Eastern&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the&amp;nbsp;2022-03-13 02:03:00 Australia/Sydney as an example, per&amp;nbsp;&lt;A href="https://www.worldtimebuddy.com/" target="_blank"&gt;Time Converter and World Clock - Conversion at a Glance - Pick best time to schedule conference calls, webinars, online meetings and phone calls. (worldtimebuddy.com) &lt;/A&gt;&lt;/P&gt;&lt;P&gt;The correct result should be&amp;nbsp;2022-03-12 10:03:00 US/Eastern instead of 2022-03-12 11:03:00 US/Eastern&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="T2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20636i500415BC60825E88/image-size/large?v=v2&amp;amp;px=999" role="button" title="T2.png" alt="T2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. From US/Eastern to other regions&lt;/P&gt;&lt;TABLE width="341"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="81"&gt;From Region&lt;/TD&gt;&lt;TD width="106"&gt;To Region&lt;/TD&gt;&lt;TD width="88"&gt;Error Count&lt;/TD&gt;&lt;TD width="66"&gt;Total Test&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;Asia/Seoul&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;Australia/Sydney&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;Europe/London&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;Europe/Paris&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;GB-Eire&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;GMT&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;US/Eastern&lt;/TD&gt;&lt;TD&gt;Japan&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;TD&gt;8761&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conclusion:&lt;/P&gt;&lt;P&gt;MET&amp;lt;-&amp;gt; US/Eastern conversion has many errors and can't be used in production&lt;/P&gt;&lt;P&gt;Other Regions-&amp;gt;US/Eastern result is acceptable&lt;/P&gt;&lt;P&gt;US/Eastern-&amp;gt;Other regions has some errors around the clock change dates. Depends on the requirement it could be used.&lt;/P&gt;&lt;P&gt;Finally - why Splunk doesn't provide native TZ Conversion function is a question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 22:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606707#M105390</guid>
      <dc:creator>Ginger_chacha</dc:creator>
      <dc:date>2022-07-22T22:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606723#M105391</link>
      <description>&lt;P&gt;I suppose it's "by design". Your user has a defined time zone and splunk renders all times in that zone while internally representing the timestamps as epoch-based unix timestamps.&lt;/P&gt;&lt;P&gt;I know that there are some border-cases (mostly when you're working in some multinational environment and want to have a different timezone based view on something to see how it corresponds to - for example - another country based team work schedule) but for most part it's actually a pretty sound design choice. If people suddenly started casting timestamps into various timezones, you would have no way of telling whether "10:41" means 10:41UTC or 10:41CET.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2022 08:22:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/606723#M105391</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-23T08:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Timezone conversion function.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/703025#M116274</link>
      <description>&lt;P&gt;came in handy here in Germany after Winter-Time Change&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 15:24:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-timezone-conversion-function-in-splunk-to-convert/m-p/703025#M116274</guid>
      <dc:creator>carbdb</dc:creator>
      <dc:date>2024-10-29T15:24:47Z</dc:date>
    </item>
  </channel>
</rss>

