Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on time calculation 1

Status
Not open for further replies.

cyoung

Programmer
Oct 31, 2001
188
US
I have a situation where I need to figure out the number of minutes between 2 different times.

I am creating an automation program that will send jobs for production upto a certain time, and the amount of time that a job needs varies based on the quantity in that job.

I do not want any thing sent for production that will take longer to finish than the end time, which is 4:30pm

If the current time is 2:30pm, then there are 120 minutes left for production. How would I programatically figure out the number of minutes between the 2 times?

Thanks!
 
Use the datediff function, the n is for minutes.
MsgBox DateDiff("n", "2:30 PM", "3:25 PM")


"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
DrJavaJoe,

Thanks for the quick response. Works perfectly!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top