New time error with AddSeconds - InfoPath Dev
in

InfoPath Dev

New time error with AddSeconds

Last post 12-26-2013 06:49 AM by Joy_T. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-25-2012 09:04 AM

    • Joy_T
    • Not Ranked
    • Joined on 10-25-2012
    • Posts 20

    New time error with AddSeconds

    I have an InfoPath form that has been working fine for over a year and suddenly started having issues yesterday (though no changes have been made to it in multiple weeks).  The form is set to be compatible with InfoPath Filler 2007 and was made in InfoPath 2007. 

    I have a field for the Start Time of the conference being requested ("StartTime").  The line below it reads, "Rooms must be booked at or before:" followed by an auto-calculating field based on the start time.  If nothing has been entered into the StartTime field, the auto-calculating field displays "30 minutes prior to start."  I have the field calculation set to "addSeconds(StartTime, -1800)" since I need it to auto-calculate the time 30 minutes prior to the time they have entered in the Start Time field.  This had been working perfectly.  However, in the last day, the calculation has somehow gotten messed up.  It seems to be somehow adding 4 hours to the StartTime before subtracting the 30 minutes.  As mentioned, I have not changed any settings.  Any ideas?

    Thanks!

  • 10-25-2012 10:36 AM In reply to

    Re: New time error with AddSeconds

    And the Start Time field is set to now()?
    Infopath filler form runs on client and gets time from client machine.operating system so probably the time on client machine cold have been disconfigured

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 10-25-2012 10:46 AM In reply to

    • Joy_T
    • Not Ranked
    • Joined on 10-25-2012
    • Posts 20

    Re: New time error with AddSeconds

    No, StartTime is entered by the user (8:00 am or what ever time their meeting will start).

    It is having the issue on all company laptops that it has been opened on in the last 2 days.

  • 11-09-2012 04:20 AM In reply to

    Re: New time error with AddSeconds

    We have seen that an MS update is now making the Time data types to also include an offset that represents time differential to GMT.  Are you in a time zone -4?

  • 12-26-2013 06:49 AM In reply to

    • Joy_T
    • Not Ranked
    • Joined on 10-25-2012
    • Posts 20

    Re: New time error with AddSeconds

    The solution that worked:

    I had to create two additional fields.

    The first additional field is "StartTime_totext" and it is a text field whose value is set to the value of the "StartTime" field.

    The second additional field is "StartTime_removeTZ" whose value is set to substring(StartTime_totext, 1, 8) which therefore cuts off the value at 8 characters (thereby removing the time zone information).

    Finally, my original TimeCalc field value is now set to addSeconds(StartTime_removeTZ, -1800) which subtracts 30 minutes from the StartTime.

    The two additional fields are set to 0 px width so that they are invisible.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.