DateTimeFormatInfo.GetFormat(Type) 方法

定義

傳回指定型別的物件,這個物件提供日期和時間格式設定服務。

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

需要的格式服務的類型。

傳回

如果 與目前 DateTimeFormatInfo 的類型相同, formatType 則為目前的 物件, null 否則為 。

實作

備註

Format(String, IFormatProvider) 底資料類型所支援的方法會在傳遞目前的 DateTimeFormatInfo 物件做為 IFormatProvider 參數時叫用這個方法。 這個方法會實作 IFormatProvider.GetFormat

適用於

另請參閱