|
1172 | 1172 |
|
1173 | 1173 | Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example:
|
1174 | 1174 |
|
1175 |
| -``` |
| 1175 | +```txt |
1176 | 1176 | (GMT+02:00) Athens, Beirut, Istanbul, Minsk
|
1177 | 1177 | (GMT-02:00) Mid-Atlantic
|
1178 | 1178 | (GMT-07:00) Mountain Time (US & Canada)
|
1179 | 1179 | ```
|
1180 | 1180 |
|
1181 |
| - |
1182 |
| - |
1183 | 1181 | ## Examples
|
1184 | 1182 | The following example creates a custom time zone for the Mawson and Holme Bay regions of Antarctica. It then displays the result of converting the local time to the time in the new time zone.
|
1185 | 1183 |
|
|
1293 | 1291 |
|
1294 | 1292 | Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example:
|
1295 | 1293 |
|
1296 |
| -``` |
| 1294 | +```txt |
1297 | 1295 | (GMT+02:00) Athens, Beirut, Istanbul, Minsk
|
1298 | 1296 | (GMT-02:00) Mid-Atlantic
|
1299 | 1297 | (GMT-07:00) Mountain Time (US & Canada)
|
|
1445 | 1443 |
|
1446 | 1444 | Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example:
|
1447 | 1445 |
|
1448 |
| -``` |
| 1446 | +```txt |
1449 | 1447 | (GMT+02:00) Athens, Beirut, Istanbul, Minsk
|
1450 | 1448 | (GMT-02:00) Mid-Atlantic
|
1451 | 1449 | (GMT-07:00) Mountain Time (US & Canada)
|
1452 | 1450 | ```
|
1453 | 1451 |
|
1454 | 1452 | A time zone's adjustment rules are defined by doing the following:
|
1455 | 1453 |
|
1456 |
| -1. Calling either the <xref:System.TimeZoneInfo.TransitionTime.CreateFloatingDateRule%2A> or the <xref:System.TimeZoneInfo.TransitionTime.CreateFixedDateRule%2A> method to define the starting and ending transition rules for each adjustment rule. |
| 1454 | +1. Calling either the <xref:System.TimeZoneInfo.TransitionTime.CreateFloatingDateRule%2A> or the <xref:System.TimeZoneInfo.TransitionTime.CreateFixedDateRule%2A> method to define the starting and ending transition rules for each adjustment rule. |
1457 | 1455 |
|
1458 |
| -2. Calling the <xref:System.TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule%2A> method for each adjustment rule. |
| 1456 | +2. Calling the <xref:System.TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule%2A> method for each adjustment rule. |
1459 | 1457 |
|
1460 |
| -3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. |
| 1458 | +3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. |
1461 | 1459 |
|
1462 | 1460 | If `disableDaylightSavingTime` parameter is `false`, the operation of this method is identical to the <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A?displayProperty=nameWithType> overload. If `disableDaylightSavingTime` is `true`, the returned object includes no adjustment rules and a <xref:System.TimeZoneInfo.DaylightName%2A> property whose value is an empty string.
|
1463 | 1461 |
|
1464 |
| - |
1465 |
| - |
1466 | 1462 | ## Examples
|
1467 | 1463 | The following example creates a custom time zone for the Palmer station and Anvers Island in Antarctica. It sets the `disableDaylightSavingTime` parameter in the call to the <xref:System.TimeZoneInfo.CreateCustomTimeZone%2A?displayProperty=nameWithType> method to `true`. It then displays the new time zone's daylight saving time name, if one is present, and the number of adjustment rules to confirm that the new time zone has no daylight saving time information.
|
1468 | 1464 |
|
|
1621 | 1617 |
|
1622 | 1618 | Time zone display names for Windows system time zones follow a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. For Coordinated Universal Time, the GMT acronym with no offset is enclosed in parentheses. This is followed by a string that identifies the time zone or one or more of the cities, regions, or countries in the time zone. For example:
|
1623 | 1619 |
|
1624 |
| -``` |
| 1620 | +```txt |
1625 | 1621 | (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London
|
1626 | 1622 | (GMT+02:00) Athens, Beirut, Istanbul, Minsk
|
1627 | 1623 | (GMT-02:00) Mid-Atlantic
|
1628 | 1624 | (GMT-07:00) Mountain Time (US & Canada)
|
1629 | 1625 | ```
|
1630 | 1626 |
|
1631 |
| - |
1632 |
| - |
1633 | 1627 | ## Examples
|
1634 | 1628 | The following example retrieves a <xref:System.TimeZoneInfo> object that represents the local time zone and outputs its display name, standard time name, and daylight saving time name. The output is displayed for a system in the U.S. Pacific Standard Time zone.
|
1635 | 1629 |
|
|
0 commit comments