Write a C# Program to Get the Universal Time

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading;

using System.Threading.Tasks;

using System.Xml;


namespace ConsoleApplication

{

    class Program

    {

        static void Main(string[] args)      

        {

            TimeZone tzone = TimeZone.CurrentTimeZone;

            DateTime datetime = tzone.ToUniversalTime(DateTime.Now);

            Console.WriteLine("Universal Time is : "+datetime);

            Console.ReadKey(); 

        }

    }

}


Output:-

Universal Time is : 05-21-2025 08:37:06

एक टिप्पणी भेजें

0 टिप्पणियाँ