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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to check if it's between 12:00 am and 1:00 am

Status
Not open for further replies.

cpalacios

Programmer
Aug 7, 2001
8
CA
Is there a way that I can check to see if the time is betwen 12:00am and 1:00 am. I need to do one event during that hour, but it doesn't matter when the time is, as long as it's between 12:00 am and 1:00 am.

Thank you in advance!
 
Would it be easier to use a Scheduler to schedule this program as a task at midnight, or is this a Terminate-And-Stay-Resident (TSR) program?

Scheduler is available on both Win9x and NT. Go to your Windows Explorer, and look for "Scheduled Tasks" in the left pane.

If it's a TSR program (like in the system tray), you may try an OS-level timer, rather than VB's Timer control.

Here is an article:
 
You could do something like this:

If Hour(Now()) < 1 Then
' do something here
End If

drost
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top