Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 1, 1997

Evaluating Elapsed Minutes

You might need to keep track of the total minutes between one date or time and another. To get the total minutes, use a line like this:
 
lTotalMinutes = Minutes(Now) - _
        Minutes(datStartTime)

This function returns the number of minutes since 01/01/1900:

Public Function Minutes(d As Date) _
        As Long
        'Minutes since 1900
        Dim lPreviousDays As Long
        Dim lTotalMinutes As Long

        lPreviousDays = d - #1/1/1900#
        lTotalMinutes = _
                (lPreviousDays * 24) * 60
        lTotalMinutes = lTotalMinutes + _
                Hour(d) * 60
        lTotalMinutes = lTotalMinutes + _
                Minute(d)

        Minutes = lTotalMinutes
End Function
Orville P.
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date