Type Method_StringProcessing
date(_:locale:timeZone:calendar:)
Date. The string is expected to follow the format of what Date.FormatStyle(date:locale:calendar:) produces. Date created by this regex component would be at 00:00:00 in the specified time zone.static func date(_ style: Date.FormatStyle.DateStyle, locale: Locale, timeZone: TimeZone, calendar: Calendar? = nil) -> Date.ParseStrategy
Parameters
styleThe style that describes the date string. For example,
.numericmatches “10/21/2015”, and.abbreviatedmatches “Oct 21, 2015” as October 21, 2015 in theen_USlocale..omittedis invalid.localeThe locale of the string to be matched. Generally speaking, the language of the locale is used to parse the date parts if the string contains localized numbers or words, and the region of the locale specifies the order of the date parts. For example, “3/5/2015” represents March 5th, 2015 in
en_US, but represents May 3rd, 2015 inen_GB.timeZoneThe time zone to create the matched date with. For example, parsing “Oct 21, 2015” with the PDT time zone returns a date representing October 21, 2015 at 00:00:00 PDT.
calendarThe calendar with which to interpret the date string. If nil, the default calendar of the specified
localeis used.
Return Value
A RegexComponent to match a localized date string.