Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Time Calculation.

    Dear,

    How to calculate Time in ASP, i have a senario is to calculate employee's working hours.

    my source data is :
    1/7/2004 : TimeIn :08:00am; BreakOut:12:00pm; BreakIn:13:00pm; TimeOut: 18:00pm
    2/7/2004 : TimeIn :09:00am; BreakOut:12:30pm; BreakIn:13:12pm; TimeOut: 17:09pm
    .
    .
    .

    so i need to calculate the total working hours for the employee, then minus the fixed working hours 8 hours per day=248hrs i will get the OT hours. but when i do calculation i might get 233.92, it suppose not appear 233.92 it should be sown 234.32(234 hrs 32 mins)

    i try to use Hourformat but i wha ti get is the timeStamp like 04 :47...
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Use the DateDiff function, it can also be used for times.

    diff = datediff("N","9:00am","10:00am")
    response.write diff

  • #3
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    glenngv knows what he is talking about.

    Here's some tutorials: http://www.aspin.com/func/search?hid...atediff&cat=tu


  •  

    Posting Permissions

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