TimeZone creation

In this chapter you will learn:

  1. How to create TimeZone

Current TimeZone

TimeZone.CurrentTimeZone method returns a TimeZone object based on the current local settings.

using System;/*ja v a2s.co m*/
using System.Text;
class Sample
{
    public static void Main()
    {
        TimeZone zone = TimeZone.CurrentTimeZone;
        Console.WriteLine(zone.StandardName);
        Console.WriteLine(zone.DaylightName);  

    }
}

The output:

Next chapter...

What you will learn in the next chapter:

  1. Standard Date Time Formatter in C#
Home » C# Tutorial » Date, Time, TimeZone
Compare DateTimeOffset
DateTimeOffset creation
Date time Value from DateTimeOffset
Compare DateTime value
DateTime constant value
DateTime constructor
DateTime properties
Create TimeSpan From
TimeSpan
TimeSpan add and subtract
DateTime and TimeSpan
Compare TimeSpan
TimeSpan constant
TimeSpan Constructor
TimeSpan Duration
TimeSpan format
Negate a TimeSpan
TimeSpan operators
Parse string to TimeSpan
TimeSpan to string
TimeSpan total properties
TimeSpan propeties
Daylight saving
Time zone ID
UTC offset with TimeZone
TimeZone converting
TimeZone creation