1 Reply Latest reply on Mar 17, 2015 2:39 PM by gkaiseril

    How do I create a time field that's export value is 3 hours ahead of the current time?

    hmiron1226

      I need to create a field on one of our forms that takes the current time from another field and adds 3 hours to it. The JavaScript to pull the current time is:

       

      var tm = this.getField("Time");

      if(tm.value == '' || tm == ' ') tm.value =
      util.printd("HH:MM tt",new Date());

        • 1. Re: How do I create a time field that's export value is 3 hours ahead of the current time?
          gkaiseril MVP & Adobe Community Professional

          Does your posted script work as expected?

           

          It does not fill-in the field for me.

          Is that code to get the time from a field or set the time for a field?

           

          Is the field you are trying to update?

           

          A time string for a computation is very limited or error prone unless it includes the date. There are many locations in the world that still observe Day Light Savings Time or Summer/Winter time and the time either moves forward one hour or falls back one hour at a certain date and time as prescribed by national or local law. So if one want to add 3 hours 1 hour before the time sift for the spring that would be 11:00pm adding 3 hours would result in a time value of 3:00 am the next day and not 2:00 am the next day. The hour between 1:00 am and 2:00 am does not exist for the local time zone.