Solved

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

Posted on 2004-10-15
2
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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