Listing 1 shows how to use the year, month, and day components to get the corresponding units of the current Gregorian calendar date as a DateComponents instance.コード出力 1 は、year、month、そしてday構成要素を使って現在のグレゴリオ暦日付の対応する単位をDateComponentsインスタンスとして取得する方法を示します。
Listing 1 Getting the Gregorian year, month, and day of month from the current date.コード出力 1 グレゴリオ年、月、そして日にちを現在の日付から取得する。
Returns all the date components of a date, as if in a given time zone (instead of the Calendar time zone).
ある日付の日付構成要素のすべてを返します、与えられたタイムゾーンを使います(Calendarタイムゾーンの代わりに)。