Solved

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

Posted on 2004-10-15
2
176 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
Comment Utility
       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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now