5 Replies Latest reply on Jun 24, 2008 6:35 AM by kglad


    JohnWalsh2011 Level 1
      Hi All

      I am creating a Countdown timer and I want to cater to all locations, but I cannot retrieve
      GMT-1000 from the date Object. Why is this? How do I know what target time to display?

      The time I want to target is CET 20.45.

      I used the '.getTimezoneOffset();' method but this returns various timezones for
      some countries and the exact number for others.

      Can I can use the setDate() to set my local time and then cross reference it with the local Timezone or
      is there another solution to my problem?

      Any help will be much appreciated


        • 1. Re: Timezone
          kglad Adobe Community Professional & MVP
          local to what?

          the server? if so, use server-side script to return the server time. local to

          the user? if you're willing to assume the user's local time is accurate you can retrieve that with the flash date class.

          otherwise, you're out of luck.
          • 2. Re: Timezone
            JohnWalsh2011 Level 1
            Hi kglad

            Thank you for replying to my query, I created the first prototype of the Countdown timer you can view it @ the link below to understand what I am trying to achieve:

            Working example

            I am a beginner to programming, so please bear with me in trying to conclude what I mean to convey to you.

            A snippet of AS that I want to implement:

            // I want to place a routine here that checks the locale of the user.
            // Adjust a variable based on the locale
            var today:Date = new Date();
            var currentYear = today.getFullYear();
            var usersHour:Array = new Array(0,0);

            // Pseudo code
            if users locale is Ireland
            switch usersHour[0] to 19 and usersHour[1] to 45
            if users locale is EST
            switch usersHour[0] to 14 and usersHour[1] to 45
            I wish to use about 5 Timezones
            switch usersHour[0] to 20 and usersHour[1] to 45

            var targetDate:Date = new Date(currentYear, 5, 29, usersHour[0], usersHour[1]);

            I hope this is clear and cogent to you!

            • 3. Re: Timezone
              kglad Adobe Community Professional & MVP
              when you use the date() object you're obtaining local time/date as set on the user's computer. if you're willing to assume that time is set accurately, you can use that along with the your server's time/date to determine the user's timezone.
              • 4. Re: Timezone
                JohnWalsh2011 Level 1
                Can I be so bold as to ask, could you point me in the direction of retrieving the servers Timezone!
                • 5. Re: Timezone
                  kglad Adobe Community Professional & MVP
                  you need to use server-side scripting. in php, check the time() or date() functions. depending on the server you may need to use an environmental variable to fix the timezone of the returned time/date.