I have a web service that need to run at a specific time each day. Within one of my events, I have the following if condition:
if (DateTime.Now.TimeOfDay.Equals(new TimeSpan(16, 00, 00)))
As you can see, I want my code within my IF condition to fire at 16:00. For some reason, the condition is never true.
I have manually output DateTime.Now.TimeOfDay.Hou
rs and DateTime.Now.TimeOfDay.Min
utes to ensure I getting the correct minutes and hours.
Am I missing something?