mc,
As Nicholas suggests, this sounds like a scheduled task.
When I want to compare "times" without the date part I normally use
TimeSpan.Compare:
Something like:
TimeSpan now = DateTime.Now.TimeOfDay;
TimeSpan onePM = TimeSpan.FromHours(13);
if (TimeSpan.Compare(now, onePM) < 0)
DoSomething();
I created a TimeRange object (in VB.NET) that is a little more flexibly then
the above sample. For details see:
http://groups.google.com/groups?q=ti...phx.gbl&rnum=2
Hope this helps
Jay
"mc" <mi*******@accuplace.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi,
Suppose I want my program to do something at 1pm everyday, how do I do the
comparison?
Thanks.
"Marcin Grzębski" <mg*******@taxussi.no.com.spam.pl> wrote in message
news:cm**********@atlantis.news.tpi.pl... Hi,
How to do a time comparison?
You should look for:
DateTime.Compare(...)
DateTime.CompareTo(...)
eventually:
DateTime.Subtract(...)
HTH
Marcin
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.782 / Virus Database: 528 - Release Date: 22/10/2004