3 Replies Latest reply on Dec 1, 2006 2:16 PM by jeddhorvath

    How to set the REAL date?

    jeddhorvath Level 1
      Folks, I need my swf to make some date-based calculations, but I want it to get the real, honest-to-god date, not the user's system clock via getDate(). Clearly I need a server-side script to return a var string to the swf with the date, but I'd prefer not to write the script. Does anyone know of a 'date server' out there that would do such a thing? Or any other brilliant solution?

      Thank you!
        • 1. Re: How to set the REAL date?
          rfkrocktk Level 1
          Well that depends on if you have a server now, doesn't it? PHP will do it for you, but I'm unsure on whether or not it's the system clock or an absolute clock.
          Example:
          $date = date('Y');
          Sets the $date variable to the date in years.

          However, I'm not sure if you're looking for this or for something entirely server-run.
          Let me know if this is something you'd be looking for, I can elaborate on PHP's date function if you'd like.
          • 2. Re: How to set the REAL date?
            I tried
            I would write a remoting call back to your server to ask it for the date right before you need to use it. Any server that can use remoting should have some sort of system date variable that you can pull, be it coldfusion, .net, PHP, or java. Maybe you can give us some more details about your operating environment.
            • 3. Re: How to set the REAL date?
              jeddhorvath Level 1
              Thanks for the responses! My environment is Java and my programmer colleague informed me I could just do something like <%= new java.util.Date().toGMTString() %> . So I'm passing that to flashvars and all is well.

              Thanks again!