Results 1 to 7 of 7

Thread: [RESOLVED] Date and Time Calculation

Threaded View

  1. #4
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Date and Time Calculation

    Not sure what calculation you mean, but I'll guess
    Code:
            Dim dt As DateTime = DateTime.Now
            Dim whenDT As DateTime = dt.Date.AddHours(21)
            Dim elaps As New TimeSpan
    
            If dt.TimeOfDay > whenDT.TimeOfDay Then
                whenDT = whenDT.AddDays(1)
            End If
            elaps = whenDT - dt
    
            'read about timespan
            Debug.WriteLine(elaps.ToString)
    Last edited by dbasnett; Jan 12th, 2010 at 09:19 AM.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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