Results 1 to 2 of 2

Thread: Time manipulations

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    5

    Time manipulations

    Hi,

    I'm trying to perform several manipulations to time values (all will be stored in a access database). I need to find the elapsed time between a start time and a finish time and I also need to be able to find the SUM of multiple time values.

    I know how to do this first part of the using the following code but how do I add multiple time values together when they are in the "15:53:12" format?

    TIA

    Russ

    Dim TimeStart, TimeStop As Date
    Dim TimeDiff As TimeSpan

    TimeStart = CDate(Me.txtTimeStart.Text)
    TimeStop = CDate(Me.txtTimeStop.Text)

    TimeDiff = TimeStop.Subtract(TimeStart)
    Regards,
    Russ

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Code:
            Dim ts As TimeSpan = TimeSpan.Parse("15:53:12")
            ts = ts.Add(TimeSpan.Parse("00:10:00"))
            ts = ts.Add(TimeSpan.Parse("00:01:00"))
            MsgBox(ts.ToString)

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