<?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: Time stamp format to round to nearest hour GMT Timezone in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620970#M106976</link>
    <description>&lt;P&gt;If you put the three fields together into a single string then you can use strptime, relative_time, and strftime to do the job.&amp;nbsp; Note that Splunk always displays timestamps in the user's selected time zone.&amp;nbsp; There is no way to force GMT (or any other time zone).&lt;/P&gt;&lt;P&gt;See if this helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval timestamp=start_date . " " . start_time . time_zone
| eval epoch = strptime(timestamp, "%Y-%m-%d %H:%M:%S:%2N%z")
| eval display_string = strftime(relative_time(epoch,"+1h@h"), "%a %b %d %H:%M:%S %Z %Y")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 15 Nov 2022 21:03:39 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-11-15T21:03:39Z</dc:date>
    <item>
      <title>Time stamp format to round to nearest hour GMT Timezone</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620964#M106974</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a start time column in splunk in this format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;19:10:54:19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a start date column in this format: 2022-11-15&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have a time zone column in this format: -500&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I get a new column with time rounded up to the next hour, in GMT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Example of output: Mon Mar 21 18:00:00 GMT 2022&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 19:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620964#M106974</guid>
      <dc:creator>Sammy13</dc:creator>
      <dc:date>2022-11-15T19:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Time stamp format to round to nearest hour GMT Timezone</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620970#M106976</link>
      <description>&lt;P&gt;If you put the three fields together into a single string then you can use strptime, relative_time, and strftime to do the job.&amp;nbsp; Note that Splunk always displays timestamps in the user's selected time zone.&amp;nbsp; There is no way to force GMT (or any other time zone).&lt;/P&gt;&lt;P&gt;See if this helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval timestamp=start_date . " " . start_time . time_zone
| eval epoch = strptime(timestamp, "%Y-%m-%d %H:%M:%S:%2N%z")
| eval display_string = strftime(relative_time(epoch,"+1h@h"), "%a %b %d %H:%M:%S %Z %Y")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 21:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620970#M106976</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-15T21:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Time stamp format to round to nearest hour GMT Timezone</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620971#M106977</link>
      <description>&lt;P&gt;Thanks a lot will apply and see if it works&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 21:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-stamp-format-to-round-to-nearest-hour-GMT-Timezone/m-p/620971#M106977</guid>
      <dc:creator>Sammy13</dc:creator>
      <dc:date>2022-11-15T21:11:53Z</dc:date>
    </item>
  </channel>
</rss>

