Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-10-15
2
Medium Priority
?
184 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

721 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