How to substract time in infopath - InfoPath Dev
in

InfoPath Dev

How to substract time in infopath

Last post 10-26-2013 11:33 PM by Abhishek.kk. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-24-2013 12:12 PM

    How to substract time in infopath

    Hi,

    I am new to infopath. I created 2 text boxes. In one of them i will paste the time in "10/24/2013 5:52:36 PM" format. I want in other box  the time should be :-

    2nd box - 10/24/2013 5:52:36 PM - 2hours = 10/24/2013 3:52:36 PM GMT

     Please help me with the same.

     

     

    Regards

    Abhishek

    Regards
    Abhishek
  • 10-25-2013 12:38 AM In reply to

    Re: How to substract time in infopath

    You might want to separate the date and time into 2 fields.

    You could use the addseconds function, if you consistently wanted 2 hours.

     i.e. addseconds(timefield),7200)

     you could also do something  like the following addseconds(substring-after(now(),"T"),7200) if you used the now function.

    Anything more complicated you'll most likely need other fields so that you can do the math easier.

     

  • 10-25-2013 12:41 AM In reply to

    Re: How to substract time in infopath

     Obviously if you want to take away 2 hours add a minus sign in front of your seconds - addseconds(substring-after(now(),"T"),-7200)

  • 10-26-2013 11:33 PM In reply to

    Re: How to substract time in infopath

    Hi, Thanks for reply. Here is what i want to do:- I have created three text boxes, where people will paste a value in first text box in this format - (10/24/2013 5:52:36 PM) specifically Now the other two boxes should automatic calculate time as :- 2nd text box - 10/24/2013 5:52:36 PM - 2 hours = 10/24/2013 3:52:36 PM and 3rd text box - 10/24/2013 5:52:36 PM - 6 hours = 10/24/2013 11:52:36 PM. Regards Abhishek
    Regards
    Abhishek
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.