Solved

check time

Posted on 2013-06-26
5
248 Views
Last Modified: 2013-06-27
How can I check if the time is past 4:40pm?

if Datetime.now.hour > 4 and datetime.now.minute>=40  ?
0
Comment
Question by:VBdotnet2005
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
if Datetime.now.hour >= 16 and datetime.now.minute>=40

Open in new window

0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
Comment Utility
Also :

If Now.TimeOfDay > New TimeSpan(16, 40, 0) Then
0
 

Author Comment

by:VBdotnet2005
Comment Utility
Is this right?
if Datetime.now.hour >= 16 and datetime.now.minute>=40

what if the hr is 20 and min is 30?

Datetime.now.hour >= 16  would be true and datetime.now.minute>=40 would be false.

I just want to know if the time has past 16:40.
0
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
Comment Utility
Ah. Good point. James' suggestion would probably be better (in terms of succinctness), but to correct:

if (Datetime.now.hour >= 16 andalso datetime.now.minute>=40) OrElse DateTime.Now.Hour > 16 Then

Open in new window

0
 

Author Closing Comment

by:VBdotnet2005
Comment Utility
Thank you again
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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