Results 1 to 2 of 2

Thread: [RESOLVED] [2005] TimeSpan TotalHours second shift incorrect

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    71

    [RESOLVED] [2005] TimeSpan TotalHours second shift incorrect

    I have a timesheet app that takes in two sets of time in the following format hh:mm tt

    example:

    StartTime = 1:00 AM
    EndTime = 1:15 PM
    TotalHours = 12.25

    I get these result because of the following code


    Code:
    CDate(strEndTime).Subtract(CDate(strStartTime)).TotalHours
    The issue I have is that if the following scenario happens

    example:

    StartTime = 10:21 PM
    EndTime = 2:21 AM
    TotalHours = -20.00


    Instead of it displaying 4 hours it display -20. It is possible that someone working the second shift would work from 10:21 PM to 2:21 AM.
    How can I correct this issue?
    Last edited by cedtech23; Dec 11th, 2006 at 12:00 AM.

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