7 Replies Latest reply on Jan 9, 2009 7:52 AM by kglad

    Clock .getUTC not working

    bolszo
      Hi,
      I'm trying to create a clock which will show time from a given time zone. In this case I'm using the .getUTC command. I have a problem though as it is working in adobe flash when I do the "Test Movie" option but later after exporting it shows time from my computer. Can anyone help me please.


      Thanks in advance.
        • 1. Re: Clock .getUTC not working
          kglad Adobe Community Professional & MVP
          that's what the date class does.
          • 2. Re: Clock .getUTC not working
            bolszo Level 1
            So how do I get the time from a given time zone in my clock? I don't fully understand your answer... what does the code do? It is supposed to do what I want it to do but still there must be something wrong in it as it is not working. Instead of showing time from a given time zone it is showing the time from the users computer.
            Could you help me in creating a code which will show time from a time zone.
            Thanks!
            • 3. Re: Clock .getUTC not working
              kglad Adobe Community Professional & MVP
              the date object returns data according to the user's local time/date.

              if you use one of the UTC methods, the values returned will reflect the not only the user's local time/date but the user's relationship between local and universal time/date.
              • 4. Re: Clock .getUTC not working
                bolszo Level 1
                Ok. I understand that. How can I create a clock that will show precisely the hour from my time zone (what code to use). No matter on which computer will it be opened the time will always be the same (my time zone). Can anyone help me with that. Let's assume that I want to make a clock which will show the time 1 hour plus to UTC no matter in which part of world will it be used.
                Thanks
                • 5. Re: Clock .getUTC not working
                  kglad Adobe Community Professional & MVP
                  with minimal server-side coding you can detect the server's time. and you can use flash to detect the user's local time (assuming their clock is set correctly which is a big assumption).

                  alternatively, you can use javascript to detect the user's timezone offset using the js date object.
                  • 6. Re: Clock .getUTC not working
                    bolszo Level 1
                    Hmm so there is no way of coding the actionscript in such a way: no matter where the clock is opened (in which part of the world) it always shows time which is actual in Germany. Thats what I want to do. I want to have a clock showing only the time in Germany for each user - even one from USA.
                    Thanks for your help.
                    • 7. Re: Clock .getUTC not working
                      kglad Adobe Community Professional & MVP
                      not with actionscript alone.