Results 1 to 2 of 2

Thread: DateDiff in .net seems to round down how can i make it round up!?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    DateDiff in .net seems to round down how can i make it round up!?

    DateDiff in .net seems to round down how can i make it round up!?:
    e.g difference is 21.51 but date diff returns 21
    i want it to round correctly ie give me 22mins.

    Any trick to get this behaviour??

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: DateDiff in .net seems to round down how can i make it round up!?

    vb Code:
    1. math.Ceiling(endDate.Subtract(startDate).TotalSeconds / 60)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width