<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Time Calculations</title><link>https://www.infopathdev.com:443/forums/thread/15038.aspx</link><pubDate>Tue, 20 Feb 2007 14:30:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15038</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15038.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15038</wfw:commentRss><description>DuneBug is exactly right on this one. You will want to do something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;DateTime startTime = DateTime.Parse( stringValueOfStartTimeField );&lt;br /&gt;DateTime endTime = DateTime.Parse( stringValueOfEndTimeField );&lt;br /&gt;&lt;br /&gt;TimeSpan duration = endTime.Subtract( startTime );&lt;br /&gt;string output = duration.Hours + ":" + duration.Minutes; // Assumes &amp;lt; 24 hours, also probably want to add zero padding&lt;br /&gt;// same thing for mttr&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This has been discussed several times on the forum so you might want to do a quick search if you run into trouble.</description></item><item><title>Re: Time Calculations</title><link>https://www.infopathdev.com:443/forums/thread/15037.aspx</link><pubDate>Fri, 16 Feb 2007 20:19:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15037</guid><dc:creator>DuneBug</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15037.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15037</wfw:commentRss><description>you may've already thought of this, and i'm not sure what environment you're using, but do you know about the system.Datetime object?&lt;br /&gt;&lt;br /&gt;As long as you're working with Microsoft I'd think you'd have it available to you. Here's a link with some documentation on it.&lt;br /&gt;&lt;br /&gt;If you have to do math with dates and times using a pre-made object is the only way to do it.&lt;br /&gt;&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://msdn2.microsoft.com/en-us/library/system.datetime.aspx&gt;http://msdn2.microsoft.com/en-us/library/system.datetime.aspx&lt;/a&gt;</description></item><item><title>Re: Time Calculations</title><link>https://www.infopathdev.com:443/forums/thread/15036.aspx</link><pubDate>Thu, 25 Jan 2007 20:05:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15036</guid><dc:creator>snyderjd</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15036.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15036</wfw:commentRss><description>Thank you, this does work, but only if dealing with time whick limits me to a 24 hour period.  I need to be able to calculate date and time... some times start on one day but end on the next day...</description></item><item><title>Re: Time Calculations</title><link>https://www.infopathdev.com:443/forums/thread/15035.aspx</link><pubDate>Wed, 24 Jan 2007 08:06:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15035</guid><dc:creator>Shilpa Pitta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15035.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15035</wfw:commentRss><description>Hi&lt;br /&gt;Check this link,Hope this helps you!&lt;br /&lt;a target="_blank" href=http://enterprise-solutions.swits.net/infopath2003/article.php?t=time-calculations-using-rules&amp;c=infopath2003&gt;http://enterprise-solutions.swits.net/infopath2003/article.php?t=time-calculations-using-rules&amp;c=infopath2003&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And for your second question, You want to enter the date and time manually or by using the date picker?</description></item><item><title>Time Calculations</title><link>https://www.infopathdev.com:443/forums/thread/13037.aspx</link><pubDate>Tue, 23 Jan 2007 22:51:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13037</guid><dc:creator>snyderjd</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13037.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13037</wfw:commentRss><description>OK, I have been searching high an low to figure out a way to do this without using managed code. I think the only way to this is with scripting or coding. I think I would prefer to use jscript if possible... as i hae some other jscript in place already... &lt;br /&gt;&lt;br /&gt;I have 5 fields: StartTime, ReportTime, EndTime, OutageDuration, &amp; MTTR (Mean Time To Repair)&lt;br /&gt;&lt;br /&gt;What I need to do is end up with two values. Outage Duration needs to be HH:MM = EndTime - StartTime and MTTR needs to be (EndTime - ReportedTime) in minutes/60.&lt;br /&gt;&lt;br /&gt;I need to have the Start Time and Report Time and End Time be in mm/dd/yy hh/mm format ...&lt;br /&gt;&lt;br /&gt;any ideas. I have been looking high an low. I have not had very much luck.</description></item></channel></rss>