Saturday, 2 December 2017

C# Program to get the Local Time


Code:

using System;
class Program
{
    static void Main()
    {
        TimeZone zone = TimeZone.CurrentTimeZone;
        DateTime local = zone.ToLocalTime(DateTime.Now);
        Console.WriteLine("The Local Time is : {0}",local);
        Console.ReadLine();
    }
}


Output:

The Local Time is : 10/22/2013 11:01:51 PM


More C# Programs:





















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...