About 151,000 results
Open links in new tab
  1. What is the best way to calculate a time span? [closed]

    In my c# program, my requirement is to calculate a timespan for business logic execution that is inside a foreach loop I have to store time span. I am using following code for (int i = 0; i &lt...

  2. Calculation with DateTime and TimeSpan in C# - Stack Overflow

    May 12, 2017 · You save valuers as DateTime, but calculations result in TimeSpan s, as the names suggest. Why do you keep the time as string, just leave it DateTime instead of converting all the time?

  3. How can I calculate a time span in Java and format the output?

    The java.time classes use these formats by default when parsing & generating strings. For a span of time unattached to the timeline, the standard defines a format of PnYnMnDTnHnMnS where P marks …

  4. Getting time span between two times in C#? - Stack Overflow

    Hours:Minutes Lets say I have clocked in at 7:00 AM and clocked out at 2:00 PM. With my current code, I get a difference of 2 hours, but it should be 7 hours. How would I do that in C#. I was going to …

  5. Time span calculation for hours and minutes in C# - Stack Overflow

    Nov 11, 2010 · The final result should display the user the time span between the start hour and the end hour.(e.g. start work at 06:30 AM and finished at 18:30 PM, the result to display should be 12 hours). …

  6. Days, hours, minutes, seconds between two dates - Stack Overflow

    May 10, 2012 · I have two dates, one less than the other. I want to create a string such as this one "0 days, 0 hours, 23 minutes, 18 seconds" representing the difference between the two dates. How can …

  7. C# TimeSpan calculating hours - Stack Overflow

    At the same time, you are telling the ToString() method that you want the value rounded to the nearest integer value. So, any time that the fractional part of your time span in hours is greater than one-half, …

  8. How to calculate a time difference in C++ - Stack Overflow

    Apr 8, 2009 · What's the best way to calculate a time difference in C++? I'm timing the execution speed of a program, so I'm interested in milliseconds. Better yet, seconds.milliseconds.. The accepted …

  9. date - Work with a time span in Javascript - Stack Overflow

    Jan 13, 2013 · var elapsed_time = new Date() - pastDate; pastDate.toString('days-hours-minutes-seconds'); Gotten it to mostly work using Date.js, but the problem is now I'm working with a Date …

  10. visual studio 2010 - Calculate time difference and return only hours ...

    Apr 5, 2014 · I'm developing a system to calculate time difference. How can I compare two time (with date) and get the hours & minutes of the difference? Example 1: datetime1 = 1-Apr-2014 …