Check Start and End Time

D

dm1608

Hi all --

I have some code that I'm running in a windows service that I need to have a
blackout period defined within my app.config file to exclude executing the
task. Basically, I want to check a StartTime and EndTime variable and if
the current system time is between either, not to execute my code. What is
the best way to handle this kind of situation?
 
F

Family Tree Mike

dm1608 said:
Hi all --

I have some code that I'm running in a windows service that I need to have
a blackout period defined within my app.config file to exclude executing
the task. Basically, I want to check a StartTime and EndTime variable and
if the current system time is between either, not to execute my code.
What is the best way to handle this kind of situation?


You posted this separately in both VB and C# groups.

The only tricky (slightly), part, is if your start and end time span
midnight. What exactly are you having trouble with? Possible questions you
may be having are the App.Config settings as well as how to test "between".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top