DateTimeFormatInfo.PMDesignator 属性

获取或设置表示处于“下午”(中午后)的各小时的字符串指示项。

**命名空间:**System.Globalization
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Property PMDesignator As String
用法
Dim instance As DateTimeFormatInfo
Dim value As String

value = instance.PMDesignator

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

/** @property */
public void set_PMDesignator (String value)
public function get PMDesignator () : String

public function set PMDesignator (value : String)

属性值

表示处于“下午”(中午后)的各小时的字符串指示项。InvariantInfo 的默认值为“PM”。

异常

异常类型 条件

ArgumentNullException

该属性被设置为 空引用(在 Visual Basic 中为 Nothing)。

InvalidOperationException

设置该属性,并且 DateTimeFormatInfo 是只读的。

备注

如果自定义模式包括格式模式“tt”并且时间是中午后,则 DateTime.ToString 显示 PMDesignator 的值来代替格式模式中的“tt”。如果自定义模式包含格式模式“t”,则仅显示 PMDesignator 的第一个字符。

对于不使用 PM 指示项的区域性,此属性返回一个空字符串。

平台

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 命名空间
DateTimeFormatInfo.AMDesignator 属性