Check Start and End Time

  • Thread starter Thread starter dm1608
  • Start date Start date
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?
 
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".
 
Back
Top