Here's an example of setting a Datetime variable:
DateTime time = new DateTime(2002, 4, 22, 16, 8, 44);
//Time = 4/22/02 16:08:44
Retrieve just time:
Console.WriteLine("Time of Day: {0}\n", time.TimeOfDay);
Datetime's hold both date and time.
>I need to do a comparison of Time of day to a Time variable.
>
>I would use code like this:
>
>
>if (DateTime.Now.CompareTo( MyTime ) >= 0)
>
>
>My question is, say I want to set value of "12:40" to the variable Mytime. How do I define it?
>
>I tried:
>
>
>DateTime.Now.TimeOfDay MyTime = "12:40";
>
>
>But I get compiler error.
>
>Thank you in advance for your help.
(On an infant's shirt): Already smarter than Bush