Solved

Script to run a function if the time is between two different times of the day

Posted on 2004-10-15
2
178 Views
Last Modified: 2010-04-23
My VB script is terrible and I'm trying to customize a 3rd party app.  I want to run a javascript function if the system time is between two different times of the day.

So, how would I go about saying if the current time (in military time) is greater than 17:30 and less than 8:00.  
0
Comment
Question by:dgelinas
  • 2
2 Comments
 
LVL 8

Expert Comment

by:bramsquad
ID: 12321122
       If (Now.ToShortTimeString <= #5:30:00 PM#) And (Now.ToShortTimeString >= #8:30:00 AM#) Then
             'success!!!
             MsgBox("true")
        End If

~b
0
 
LVL 8

Accepted Solution

by:
bramsquad earned 500 total points
ID: 12321148
oops, it would be the other way around (change the logical ops)

       If (Now.ToShortTimeString >= #5:30:00 PM#) And (Now.ToShortTimeString <= #8:30:00 AM#) Then
             'success!!!
             MsgBox("true")
        End If
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question