1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to get browser timezone in oracle apex

Discussion in 'Oracle Application Express (APEX)' started by Bharat, Mar 22, 2019.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,753
    Likes Received:
    148
    Trophy Points:
    1,805
    Location:
    Redondo Beach, California
    Is there a way to get browser timezone in oracle apex ?

    Regards,
    Bharat
     
  2. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,753
    Likes Received:
    148
    Trophy Points:
    1,805
    Location:
    Redondo Beach, California
    Used below piece of code in html header section of the page and able to read the Browser TimeZone from this.

    Code (Javascript):
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">
    </script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js">
    </script>

    <script type="text/javascript">
      $(document).ready(function(){
        var tz = jstz.determine(); // Determines the time zone of the browser client
        var timezone = tz.name(); //'Asia/Kolhata' for Indian Time.
        apex.item("P1_BROWSER_TZ").setValue(timezone);
        //alert('&P1_BROWSER_TZ.');
       
    });
    </script>
     
    Last edited: Mar 24, 2019