1 Reply Latest reply on Oct 4, 2012 6:46 AM by Peter Arcuri

    Rho Elements new Date () not working correctly after sleeping

      This is similar to the Date/Time issues post about the time being off after sleeping.  However, we have a version where the code works on one hand held, but does not work on another, with the same OS and Rho Elements version (2.1.1.7).

       

      This sample code will show the issue.  You ensure the two hand helds have the same current time.  Run the code and select the button to see an alert of the three different Date() calls.  The first is simply the Date() object used, the second is a new Date() call, and the third is using the variable assigned to a new Date() statement.

       

      Interestingly, all three Date/Times are correct on the first pass, except the Date() call directly has the Time Zone wrong by 1 hour (GMT - 3) while the rest are correct (GMT - 4), but all three times (without sleeping) are 13:51:25.

       

      <html>

      <head>

      <script>

      function disp_time()

      {

          var d = new Date();

          alert('Date(): ' + Date() + "\nnew Date(): " + new Date() + "\nvar new Date(): " + d);

      }

      </script>

      </head>

      <body>

          <h3>Date</h3>

              <input type="button" onclick="disp_time();" value="Show Current Time" />

      </body>

      </html>