Syntax:
TimeZoneInfo TimeZoneInfo.CreateCustomTimeZone(
string id,
TimeSpan baseUtcOffset,
string displayName,
string standardname);
Parameter(s):
- id: Unique id to create custom time-zone.
- baseUtcOffset: Time offset for custom time zone.
- displayName: Display name for custom time zone.
- standardname: Standard name for custom time zone.
Return value:
It returns an object of a custom time zone.
Exception(s):
- System.ArgumentException
- System.ArgumentNullException
- System.ArgumentOutOfRangeException
-
Program:
The source code to define a time zone that is not found on the local computer is given below. The given program is compiled and executed successfully.
Output: