DateTimeFormatter.Format メソッド

定義

オーバーロード

Format(DateTime)

指定された日付と時刻の文字列形式を返します。

Format(DateTime, String)

フォーマッタが現在使用しているテンプレートに準拠して、指定されたタイム ゾーン内の指定された日付と時刻を表す文字列を返します。

Format(DateTime)

指定された日付と時刻の文字列形式を返します。

public:
 virtual Platform::String ^ Format(DateTime value) = Format;
winrt::hstring Format(DateTime const& value);
public string Format(System.DateTimeOffset value);
function format(value)
Public Function Format (value As DateTimeOffset) As String

パラメーター

value
DateTime DateTimeOffset

書式設定する日付と時刻。

戻り値

String

Platform::String

winrt::hstring

日付と時刻を表す文字列。

注釈

注意

アプリケーションで日本語カレンダーがサポートされている場合は、2019 年 5 月の日本の年号の変更が適切に処理されていることを検証する必要があります。 詳細については、「 日本の時代 (年号) の変更に合わせてアプリケーションを準備 する」を参照してください。

こちらもご覧ください

適用対象

Format(DateTime, String)

フォーマッタが現在使用しているテンプレートに準拠して、指定されたタイム ゾーン内の指定された日付と時刻を表す文字列を返します。

public:
 virtual Platform::String ^ Format(DateTime datetime, Platform::String ^ timeZoneId) = Format;
/// [Windows.Foundation.Metadata.Overload("FormatUsingTimeZone")]
winrt::hstring Format(DateTime const& datetime, winrt::hstring const& timeZoneId);
[Windows.Foundation.Metadata.Overload("FormatUsingTimeZone")]
public string Format(System.DateTimeOffset datetime, string timeZoneId);
function format(datetime, timeZoneId)
Public Function Format (datetime As DateTimeOffset, timeZoneId As String) As String

パラメーター

datetime
DateTime DateTimeOffset

書式設定する日付、時刻、およびタイムゾーン。

timeZoneId
String

Platform::String

winrt::hstring

使用するタイム ゾーンを識別する IANA タイム ゾーン データベース の識別子 (太平洋時間の場合は "南北アメリカ/Los_Angeles" など)。

戻り値

String

Platform::String

winrt::hstring

日付、時刻、タイム ゾーンを表す文字列。

属性

注釈

注意

アプリケーションで日本語カレンダーがサポートされている場合は、2019 年 5 月の日本の年号の変更が適切に処理されていることを検証する必要があります。 詳細については、「 日本の時代 (年号) の変更に合わせてアプリケーションを準備 する」を参照してください。

こちらもご覧ください

適用対象