ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

C# program to get the Coordinated Universal Time (UTC) zone (TimeZoneInfo.Utc Property)

C# TimeZoneInfo.Utc Property: Here, we are going to learn how to TimeZoneInfo.Utc Property in C#.Net?
Submitted by Nidhi, on May 07, 2021

The Utc property of TimeZoneInfo class is a static property that represents the Coordinated Universal Time (UTC) zone.

Syntax:

    TimeZoneInfo TimeZoneInfo.Utc

Return value:

It returns the object of TimeZoneInfo class that represents Coordinated universal time(UTC).

Program:

The source code to get the Coordinated Universal Time (UTC) zone is given below. The given program is compiled and executed successfully.

using System;
using System.Globalization;
using System.Collections.ObjectModel;

class TimeZoneInfoDemo
{
    //Entry point of Program
    static public void Main()
    {
        TimeZoneInfo universalTimeZone;

        universalTimeZone = TimeZoneInfo.Utc;


        Console.WriteLine("The universal time zone: "   +universalTimeZone.DisplayName);
        Console.WriteLine("Daylight savings name: "     +universalTimeZone.DaylightName);
        Console.WriteLine("Standard name: "             +universalTimeZone.StandardName);

    }
}

Output:

The universal time zone: UTC
Daylight savings name: UTC
Standard name: UTC
Press any key to continue . . .

C# TimeZoneInfo Class Programs »

ADVERTISEMENT




Comments and Discussions

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.