Time Calculation Issue With AddSeconds Function in Infopath 2010 - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » Time Calculation Issue With AddSeconds Function in Infopath 2010 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: Oldest to newest Newest to oldest Previous Next 08-21-2013 01:58 AM Cassie Joined on 07-14-2011 Posts 12 Time Calculation Issue With AddSeconds Function in Infopath 2010 Test Time Calc.xsn Reply Contact 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? Filed under: infopath 2010 forms, time calculations 08-25-2013 04:06 PM In reply to Patrick Halstead Joined on 08-07-2006 Posts 5,112 Re: Time Calculation Issue With AddSeconds Function in Infopath 2010 Test Time Calc v2.xsn Mark as Not AnswerMark as Answer... Reply Contact yes, you'll need to substring before the time zone. see modified xsn attached. Patrick HalsteadProject Manager at Qdabra Page 1 of 1 (2 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
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?
yes, you'll need to substring before the time zone. see modified xsn attached.