ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

C# program to get the standard time zone name (TimeZone.StandardName Property)

C# TimeZone.StandardName Property: Here, we are going to learn how to get the standard time zone name in C#.Net?
Submitted by Nidhi, on May 07, 2021

To get the standard time zone name – we use the StandardName property of LocalTimeZoneInfo class.

Syntax:

    string TimeZoneInfo.StandardName

Return value:

It returns a string value that denotes the standard name of the local time zone.

Program:

The source code to get the standard time zone name is given below. The given program is compiled and executed successfully.

using System;
using System.Globalization;

class TimeZoneInfoDemo
{
    //Entry point of Program
    static public void Main()
    {
        string standardName = "";
        TimeZoneInfo localTimeZone;

        localTimeZone = TimeZoneInfo.Local;
        standardName = localTimeZone.StandardName;

        Console.WriteLine("StandardName of Local Time Zone:\n" + standardName);
    }
}

Output:

StandardName of Local Time Zone:
India Standard Time
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.