DateTimeFormatInfo.GetFormat(Type) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回指定类型的对象,它提供日期和时间格式化服务。
public:
virtual System::Object ^ GetFormat(Type ^ formatType);
public object GetFormat (Type formatType);
public object? GetFormat (Type? formatType);
abstract member GetFormat : Type -> obj
override this.GetFormat : Type -> obj
Public Function GetFormat (formatType As Type) As Object
参数
- formatType
- Type
所需格式化服务的类型。
返回
如果 formatType
与当前 DateTimeFormatInfo 的类型相同,则为当前对象;否则为 null
。
实现
注解
当当前对象作为参数传递时,基数据类型支持的方法将 Format(String, IFormatProvider)
DateTimeFormatInfo 调用 IFormatProvider 此方法。 此方法实现 IFormatProvider.GetFormat。