Extracting the current date/time: Now and UtcNow : DateTime Now « Date Time « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Security.Cryptography;

public class MainClass
{
    public static void Main()
    {
        DateTime localNow = DateTime.Now;
        Console.WriteLine("{0} - {1} ({2})", localNow, localNow.Kind,
            TimeZone.CurrentTimeZone.StandardName);
        DateTime utcNow = DateTime.UtcNow;
        Console.WriteLine("{0} - {1}", utcNow, utcNow.Kind);
    }
}








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