Instance Method インスタンスメソッド

date(from:)

Returns a date representation of a specified string that the system interprets using the receiver’s current settings. 指定された文字列の日付表現を返します、それはシステムがレシーバのもつ現在の設定を使って解釈するものです。

Declaration 宣言

func date(from string: String) -> Date?

Parameters パラメータ

string

The string to parse. 構文解析する文字列。

Return Value 戻り値

A date representation of string. If date(from:) can’t parse the string, returns nil. stringの日付表現。date(from:)が文字列を構文解析できないならば、nilを返します。

Discussion 議論

For more information about using DateFormatter to convert a string to a date, see Working With Fixed Format Date Representations. For a sample code playground, see Displaying Human-Friendly Content. DateFormatterを使って文字列を日付へと変換することについてのさらなる情報として、固定された書式設定日付表現を扱うを見てください。サンプルコードプレイグラウンドとして、人にやさしい内容を表示するを見てください。

See Also 参照

Converting Objects オブジェクト変換