static void Main (string[] args)
{
DateTime dt = DateTime.Now;
Console.WriteLine (DT);
DateTime NZ = convert.todatetime ("2015-4-2 17:00");//Convert NZ time to the time the computer can recognize
for (int i = 1; i <; i++)
{
DT = dt. AddMinutes (1); System time plus 1 minutes
Console.WriteLine (dt. Toshorttimestring()); //Output time for a short time, that is, only time, no date
if (NZ. Toshorttimestring (). Equals (dt. Toshorttimestring ()))//Two time compared to the formula!! This is equal to the formula equals equal meaning
{
Console.WriteLine ("To the Point");
Console.WriteLine ("Whether to turn off the alarm (y/n)");
String B = Console.ReadLine ();
if (b.toupper () = = "N")//Convert letters to uppercase
{
NZ = NZ. AddMinutes (5);//Alarm clock time on the original basis plus 5 minutes
}
Else
{
Console.WriteLine ("Alarm has been stopped");
Break
}
}
}
Console.ReadLine ();
}
Questions about the alarm clock