다음을 통해 공유


DateTimeFormatInfo.LongDatePattern 속성

'D' 형식 문자와 관련된 자세한 날짜 값의 형식 패턴을 가져오거나 설정합니다.

네임스페이스: System.Globalization
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Property LongDatePattern As String
‘사용 방법
Dim instance As DateTimeFormatInfo
Dim value As String

value = instance.LongDatePattern

instance.LongDatePattern = value
public string LongDatePattern { get; set; }
public:
property String^ LongDatePattern {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_LongDatePattern ()

/** @property */
public void set_LongDatePattern (String value)
public function get LongDatePattern () : String

public function set LongDatePattern (value : String)

속성 값

'D' 형식 문자와 관련된 자세한 날짜 값의 형식 패턴입니다.

예외

예외 형식 조건

ArgumentNullException

속성이 Null 참조(Visual Basic의 경우 Nothing)로 설정되는 경우

InvalidOperationException

속성이 설정되어 있으며 DateTimeFormatInfo는 읽기 전용인 경우

설명

조합하여 "dddd, dd MMMM yyyy"와 같은 사용자 지정 패턴을 만들 수 있는 패턴에 대해서는 DateTimeFormatInfo를 참조하십시오.

Calendar 속성 값이 변경되면 이 속성이 영향을 받습니다.

예제

다음 코드 예제에서는 몇 가지 culture에 대한 LongDatePattern 값을 표시합니다.

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.LongDatePattern)

   End Sub 'PrintPattern 

End Class 'SamplesDTFI

'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
'  ja-JP     yyyy'?'M'?'d'?'
'  fr-FR     dddd d MMMM yyyy
'
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.LongDatePattern );

   }

}

/*
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
  ja-JP     yyyy'?'M'?'d'?'
  fr-FR     dddd d MMMM yyyy

*/
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->LongDatePattern );
}

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
ja-JP     yyyy'?'M'?'d'?'
fr-FR     dddd d MMMM yyyy

*/
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_LongDatePattern());
    } //PrintPattern 
} //SamplesDTFI

/*
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
  ja-JP     yyyy'?'M'?'d'?'
  fr-FR     dddd d MMMM yyyy
*/

플랫폼

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

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

DateTimeFormatInfo 클래스
DateTimeFormatInfo 멤버
System.Globalization 네임스페이스