Check the current second : DateTime Now « Date Time « C# / CSharp Tutorial






using System;

    class MainClass
    {
        static void Main(string[] args)
        {
            int sec = -1;
            while( DateTime.Now.Second != 0 )
            {
                if( sec != DateTime.Now.Second )
                {
                    sec = DateTime.Now.Second;
                    Console.Write( "...{0}", 60-DateTime.Now.Second );
                }
            }

        }
    }








13.2.DateTime Now
13.2.1.Extracting the current date/time: Now and UtcNow
13.2.2.Get current time
13.2.3.Check the current second