Freigeben über


DateTimeFormatInfo.SortableDateTimePattern-Eigenschaft

Ruft das Formatmuster für einen sortierbaren Datums- und Zeitwert ab, das dem Formatzeichen "s" zugeordnet ist.

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public ReadOnly Property SortableDateTimePattern As String
'Usage
Dim instance As DateTimeFormatInfo
Dim value As String

value = instance.SortableDateTimePattern
public string SortableDateTimePattern { get; }
public:
property String^ SortableDateTimePattern {
    String^ get ();
}
/** @property */
public String get_SortableDateTimePattern ()
public function get SortableDateTimePattern () : String

Eigenschaftenwert

Das Formatmuster für einen sortierbaren Datums- und Zeitwert, das dem Formatzeichen "s" zugeordnet ist.

Beispiel

In folgendem Codebeispiel wird der Wert von SortableDateTimePattern für bestimmte Kulturen angezeigt.

Imports System
Imports System.Globalization

Public Class SamplesDTFI

   Public Shared Sub Main()

      ' Displays the values of the pattern properties.
      Console.WriteLine(" CULTURE    PROPERTY VALUE")
      PrintPattern("en-US")
      PrintPattern("ja-JP")
      PrintPattern("fr-FR")

   End Sub 'Main

   Public Shared Sub PrintPattern(myCulture As [String])

      Dim myDTFI As DateTimeFormatInfo = New CultureInfo(myCulture, False).DateTimeFormat
      Console.WriteLine("  {0}     {1}", myCulture, myDTFI.SortableDateTimePattern)

   End Sub 'PrintPattern 

End Class 'SamplesDTFI

'This code produces the following output.
'
' CULTURE    PROPERTY VALUE
'  en-US     yyyy'-'MM'-'dd'T'HH':'mm':'ss
'  ja-JP     yyyy'-'MM'-'dd'T'HH':'mm':'ss
'  fr-FR     yyyy'-'MM'-'dd'T'HH':'mm':'ss
'
using System;
using System.Globalization;


public class SamplesDTFI  {

   public static void Main()  {

      // Displays the values of the pattern properties.
      Console.WriteLine( " CULTURE    PROPERTY VALUE" );
      PrintPattern( "en-US" );
      PrintPattern( "ja-JP" );
      PrintPattern( "fr-FR" );

   }

   public static void PrintPattern( String myCulture )  {

      DateTimeFormatInfo myDTFI = new CultureInfo( myCulture, false ).DateTimeFormat;
      Console.WriteLine( "  {0}     {1}", myCulture, myDTFI.SortableDateTimePattern );

   }

}

/*
This code produces the following output.

 CULTURE    PROPERTY VALUE
  en-US     yyyy'-'MM'-'dd'T'HH':'mm':'ss
  ja-JP     yyyy'-'MM'-'dd'T'HH':'mm':'ss
  fr-FR     yyyy'-'MM'-'dd'T'HH':'mm':'ss

*/
using namespace System;
using namespace System::Globalization;
void PrintPattern( String^ myCulture )
{
   CultureInfo^ MyCI = gcnew CultureInfo( myCulture,false );
   DateTimeFormatInfo^ myDTFI = MyCI->DateTimeFormat;
   Console::WriteLine( " {0} {1}", myCulture, myDTFI->SortableDateTimePattern );
}

int main()
{
   
   // Displays the values of the pattern properties.
   Console::WriteLine( " CULTURE    PROPERTY VALUE" );
   PrintPattern( "en-US" );
   PrintPattern( "ja-JP" );
   PrintPattern( "fr-FR" );
}

/*
This code produces the following output.

CULTURE    PROPERTY VALUE
en-US     yyyy'-'MM'-'dd'T'HH':'mm':'ss
ja-JP     yyyy'-'MM'-'dd'T'HH':'mm':'ss
fr-FR     yyyy'-'MM'-'dd'T'HH':'mm':'ss

*/
import System.* ;
import System.Globalization.* ;

public class SamplesDTFI
{
    public static void main(String[] args)
    {
        // Displays the values of the pattern properties.
        Console.WriteLine(" CULTURE    PROPERTY VALUE");
        PrintPattern("en-US");
        PrintPattern("ja-JP");
        PrintPattern("fr-FR");
    } //main

    public static void PrintPattern(String myCulture)
    {
        DateTimeFormatInfo myDTFI = 
            (new CultureInfo(myCulture, false)).get_DateTimeFormat();
        
        Console.WriteLine("  {0}     {1}", myCulture, 
            myDTFI.get_SortableDateTimePattern());
    } //PrintPattern 
} //SamplesDTFI

/*
This code produces the following output.

 CULTURE    PROPERTY VALUE
  en-US     yyyy'-'MM'-'dd'T'HH':'mm':'ss
  ja-JP     yyyy'-'MM'-'dd'T'HH':'mm':'ss
  fr-FR     yyyy'-'MM'-'dd'T'HH':'mm':'ss
*/

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

DateTimeFormatInfo-Klasse
DateTimeFormatInfo-Member
System.Globalization-Namespace
UniversalSortableDateTimePattern