DateTime.ToTextDateTime.ToText
構文Syntax
DateTime.ToText(dateTime as nullable datetime, optional format as nullable text, optional culture as nullable text) as nullable text
バージョン情報About
dateTime
のテキスト表現を返します。Returns a textual representation of dateTime
. テキストの書式設定をカスタマイズするために、オプションの format
を指定できます。An optional format
may be provided to customize the formatting of the text. オプションの culture
を指定することもできます (例: "en-US")。An optional culture
may also be provided (for example, "en-US").
例 1Example 1
#datetime(2011, 12, 31, 11, 56, 2) のテキスト形式の表記を取得します。Get a textual representation of #datetime(2011, 12, 31, 11, 56, 2).
DateTime.ToText(#datetime(2010, 12, 31, 11, 56, 2))
"12/31/2010 11:56:02 AM"
例 2Example 2
形式オプションを使用して、#datetime(2011, 12, 31, 11, 56, 2) のテキスト形式の表記を取得します。Get a textual representation of #datetime(2011, 12, 31, 11, 56, 2) with format option.
DateTime.ToText(#datetime(2010, 12, 31, 11, 56, 2), "yyyy/MM/ddThh:mm:ss")
"2010/12/31T11:56:02"