DateTimeFormatInfo.ShortTimePattern プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DateTimeFormatInfo.ShortTimePattern プロパティの意味・解説 

DateTimeFormatInfo.ShortTimePattern プロパティ

"t" 形式指定文字関連付けられた短い時刻の値の形式パターン取得または設定します

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Property ShortTimePattern As
 String
Dim instance As DateTimeFormatInfo
Dim value As String

value = instance.ShortTimePattern

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

/** @property */
public void set_ShortTimePattern (String value)
public function get ShortTimePattern
 () : String

public function set ShortTimePattern
 (value : String)

プロパティ
"t" 形式指定文字関連付けられた短い時刻の値の形式パターン

例外例外
例外種類条件

ArgumentNullException

プロパティnull 参照 (Visual Basic では Nothing) に設定されています。

InvalidOperationException

プロパティ設定されていますが、DateTimeFormatInfo が読み取り専用です。

解説解説

たとえば、"HH:mm" のように、カスタム パターン構築するために組み合わせることができるパターンについては、DateTimeFormatInfoトピック参照してください

使用例使用例

いくつかのカルチャの ShortTimePattern の値を表示するコードの例次に示します

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

   End Sub 'PrintPattern 

End Class 'SamplesDTFI

'This code produces the following output.
'
' CULTURE    PROPERTY VALUE
'  en-US     h:mm tt
'  ja-JP     H:mm
'  fr-FR     HH:mm
'
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.ShortTimePattern
 );

   }

}

/*
This code produces the following output.

 CULTURE    PROPERTY VALUE
  en-US     h:mm tt
  ja-JP     H:mm
  fr-FR     HH:mm

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

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     h:mm tt
ja-JP     H:mm
fr-FR     HH:mm

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

/*
This code produces the following output.

 CULTURE    PROPERTY VALUE
  en-US     h:mm tt
  ja-JP     H:mm
  fr-FR     HH:mm
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DateTimeFormatInfo.ShortTimePattern プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DateTimeFormatInfo.ShortTimePattern プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS