<?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 to get current user's timezone in html in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318028#M161018</link>
    <description>&lt;P&gt;Hi arcotdeepika,&lt;/P&gt;

&lt;P&gt;I haven't seen specific function like Splunk.util.getServerTimezoneOffset().&lt;/P&gt;

&lt;P&gt;So can you please try below javascript?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var SearchManager = require("splunkjs/mvc/searchmanager");

var mysearch = new SearchManager({
    id: 'search1',
    app: 'search',
    cache: false,
    search: '| makeresults | eval zone = strftime(now(),"%Z %z")' // changes datetime format as per your requirement.
});

var myResults = mysearch.data("results");
myResults.on("data", function()  {
    var zone = myResults.data().rows[0][0];
    console.log(zone); // You will get zone
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 May 2017 10:36:15 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2017-05-25T10:36:15Z</dc:date>
    <item>
      <title>how to get current user's timezone in html</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318027#M161017</link>
      <description>&lt;P&gt;Can you help me to get the timezone of current logged in user.&lt;/P&gt;

&lt;P&gt;I am able to get the username by below command,&lt;BR /&gt;
var currentUser =Splunk.util.getConfigValue("USERNAME");&lt;/P&gt;

&lt;P&gt;Likewise, any specific command to get users timezone. When i tried with below, it is giving same results for any timezone.&lt;/P&gt;

&lt;P&gt;offset = Splunk.util.getServerTimezoneOffset(); &lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 09:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318027#M161017</guid>
      <dc:creator>arcotdeepika</dc:creator>
      <dc:date>2017-05-25T09:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to get current user's timezone in html</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318028#M161018</link>
      <description>&lt;P&gt;Hi arcotdeepika,&lt;/P&gt;

&lt;P&gt;I haven't seen specific function like Splunk.util.getServerTimezoneOffset().&lt;/P&gt;

&lt;P&gt;So can you please try below javascript?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var SearchManager = require("splunkjs/mvc/searchmanager");

var mysearch = new SearchManager({
    id: 'search1',
    app: 'search',
    cache: false,
    search: '| makeresults | eval zone = strftime(now(),"%Z %z")' // changes datetime format as per your requirement.
});

var myResults = mysearch.data("results");
myResults.on("data", function()  {
    var zone = myResults.data().rows[0][0];
    console.log(zone); // You will get zone
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 10:36:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318028#M161018</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-05-25T10:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to get current user's timezone in html</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318029#M161019</link>
      <description>&lt;P&gt;The example in the &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.0/ModuleRef/Splunk.util#Synopsis_21"&gt;documentation&lt;/A&gt; for getServerTimezoneOffset() is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var serverOffsetSeconds = Splunk.util.getServerTimezoneOffset();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could it be that you are just missing the var declaration&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 10:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318029#M161019</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2017-05-25T10:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to get current user's timezone in html</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318030#M161020</link>
      <description>&lt;P&gt;No, Even I used 'var' get the same results.&lt;/P&gt;

&lt;P&gt;Is there any  util function exists to get tz like "username"&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 14:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318030#M161020</guid>
      <dc:creator>arcotdeepika</dc:creator>
      <dc:date>2017-05-25T14:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to get current user's timezone in html</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318031#M161021</link>
      <description>&lt;P&gt;With these, the zone prints entire date.&lt;/P&gt;

&lt;P&gt;I need the timezone string to pass to another URL as parmeter.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 14:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-current-user-s-timezone-in-html/m-p/318031#M161021</guid>
      <dc:creator>arcotdeepika</dc:creator>
      <dc:date>2017-05-25T14:26:08Z</dc:date>
    </item>
  </channel>
</rss>

