DateTimeFormatInfo.FullDateTimePattern Właściwość

Definicja

Pobiera lub ustawia ciąg formatu niestandardowego dla wartości daty długiej i czasu długiego.

public:
 property System::String ^ FullDateTimePattern { System::String ^ get(); void set(System::String ^ value); };
public string FullDateTimePattern { get; set; }
member this.FullDateTimePattern : string with get, set
Public Property FullDateTimePattern As String

Wartość właściwości

String

Ciąg formatu niestandardowego dla wartości daty długiej i czasu długiego.

Wyjątki

Właściwość jest ustawiana na null wartość .

Właściwość jest ustawiana, a DateTimeFormatInfo obiekt jest tylko do odczytu.

Przykłady

W poniższym przykładzie jest FullDateTimePattern wyświetlana wartość kilku kultur.

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->FullDateTimePattern );
}

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.  The question marks take the place of native script characters.

CULTURE    PROPERTY VALUE
en-US     dddd, MMMM dd, yyyy h:mm:ss tt
ja-JP     yyyy'年'M'月'd'日' H:mm:ss
fr-FR     dddd d MMMM yyyy 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.FullDateTimePattern );
   }
}

/*
This code produces the following output.  The question marks take the place of native script characters.

 CULTURE    PROPERTY VALUE
  en-US     dddd, MMMM dd, yyyy h:mm:ss tt
  ja-JP     yyyy'年'M'月'd'日' H:mm:ss
  fr-FR     dddd d MMMM yyyy HH:mm:ss

*/
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

   Public Shared Sub PrintPattern(myCulture As [String])

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

   End Sub

End Class

'This code produces the following output.  The question marks take the place of native script characters.
'
' CULTURE    PROPERTY VALUE
'  en-US     dddd, MMMM dd, yyyy h:mm:ss tt
'  ja-JP     yyyy'年'M'月'd'日' H:mm:ss
'  fr-FR     dddd d MMMM yyyy HH:mm:ss
'

Uwagi

Ciąg formatu standardowego "F" jest aliasem FullDateTimePattern właściwości . Innymi słowy, ciąg formatu niestandardowego przypisany do tej właściwości definiuje format ciągu wynikowego dla ciągu formatu standardowego "F". Aby uzyskać więcej informacji, zobacz Ciągi standardowego formatu daty i czasu.

Wartość właściwości jest FullDateTimePattern generowana dynamicznie przez dzielenie właściwości LongDatePattern i LongTimePattern oddzielonych spacją. To dynamiczne przypisanie odbywa się w następujących warunkach:

  • Jeśli wartość właściwości jest pobierana, zanim została jawnie ustawiona.

  • Gdy wartość właściwości LongDatePattern się zmienia.

  • Gdy wartość właściwości LongTimePattern się zmienia.

Zmiana wartości właściwości ma wpływ na Calendar tę właściwość.

Dotyczy

Zobacz też