Share via


TimeZoneInfo.StandardName Propriété

Définition

Obtient le nom d'affichage pour l'heure d'hiver du fuseau horaire.

public:
 property System::String ^ StandardName { System::String ^ get(); };
public string StandardName { get; }
member this.StandardName : string
Public ReadOnly Property StandardName As String

Valeur de propriété

String

Nom d'affichage de l'heure d'hiver du fuseau horaire.

Exemples

L’exemple suivant définit une méthode nommée DisplayDateWithTimeZoneName qui utilise la IsDaylightSavingTime(DateTime) méthode pour déterminer s’il faut afficher le nom standard d’un fuseau horaire ou le nom de l’heure d’été.

private void DisplayDateWithTimeZoneName(DateTime date1, TimeZoneInfo timeZone)
{
   Console.WriteLine("The time is {0:t} on {0:d} {1}", 
                     date1, 
                     timeZone.IsDaylightSavingTime(date1) ?
                         timeZone.DaylightName : timeZone.StandardName);   
}
// The example displays output similar to the following:
//    The time is 1:00 AM on 4/2/2006 Pacific Standard Time
let displayDateWithTimeZoneName (date1: DateTime) (timeZone: TimeZoneInfo) =
    printfn $"The time is {date1:t} on {date1:d} {if timeZone.IsDaylightSavingTime date1 then timeZone.DaylightName else timeZone.StandardName}" 
// The example displays output similar to the following:
//    The time is 1:00 AM on 4/2/2006 Pacific Standard Time
Private Sub DisplayDateWithTimeZoneName(date1 As Date, timeZone As TimeZoneInfo)
   Console.WriteLine("The time is {0:t} on {0:d} {1}", _
                     date1, _
                     IIf(timeZone.IsDaylightSavingTime(date1), _
                         timezone.DaylightName, timezone.StandardName))   
End Sub
' The example displays output similar to the following:
'    The time is 1:00 AM on 4/2/2006 Pacific Standard Time

Remarques

Le nom complet est localisé en fonction de la culture installée avec le système d’exploitation Windows.

La StandardName propriété est identique à la StandardName propriété de la TimeZone classe.

Si la langue du système d’exploitation est l’anglais, la valeur de la StandardName propriété est généralement, mais pas toujours, identique à celle de la Id propriété.

S’applique à