Time Calculation Issue With AddSeconds Function in Infopath 2010 - InfoPath Dev
in

InfoPath Dev

Time Calculation Issue With AddSeconds Function in Infopath 2010

Last post 08-25-2013 04:06 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-21-2013 01:58 AM

    Time Calculation Issue With AddSeconds Function in Infopath 2010

    I have a template part with two fields, StartTime and EndTime.  They are formatted as time in format 9:46.

    I have a calculated field ("Total") that is also fomatted in the same way.  The XPath expression for it is...

    xdDate:AddSeconds(my:EndTime, -1 * (substring(my:StartTime, 1, 2) * 3600 + substring(my:StartTime, 4, 2) * 60))

    I type 1:00 for StartTime, and 2:00 for EndTime but the Total is 17:00 when it should be 1:00

    My computer's regional settings say that we are (UTC+08:00).It seems like the AddSeconds function is taking 8 hours off my result. 

    Can anyone plases advise on whether this is some sort of bug with the AddSeconds function or how the formula should be written using the AddSeconds function?

  • 08-25-2013 04:06 PM In reply to

    Re: Time Calculation Issue With AddSeconds Function in Infopath 2010

    yes, you'll need to substring before the time zone. see modified xsn attached.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.