---
title: "date(era:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscalendar/date(era:yearforweekofyear:weekofyear:weekday:hour:minute:second:nanosecond:)"
---

# date(era:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:)

Returns a new date created with the given components base on a week-of-year value.

## Declaration

```swift
func date(era eraValue: Int, yearForWeekOfYear yearValue: Int, weekOfYear weekValue: Int, weekday weekdayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?
```

## Parameters

- `eraValue`: The value for the era component.
- `yearValue`: The value for the year component.
- `weekValue`: The value for the week-of-year component.
- `weekdayValue`: The value to use as the weekday.
- `hourValue`: The value for the hour component.
- `minuteValue`: The value for the minute component.
- `secondValue`: The value for the second component.
- `nanosecondValue`: The value for the nanosecond component.

## Return Value

Return Value A new NSDate instance created with the given components based on a week-of-year calculation, or nil if the components do not correspond to a valid date.

## See Also

### Calculating Dates

- [date(from:)](foundation/nscalendar/date(from:).md)
- [date(byAdding:to:options:)](foundation/nscalendar/date(byadding:to:options:).md)
- [date(byAdding:value:to:options:)](foundation/nscalendar/date(byadding:value:to:options:).md)
- [date(bySettingHour:minute:second:of:options:)](foundation/nscalendar/date(bysettinghour:minute:second:of:options:).md)
- [date(bySettingUnit:value:of:options:)](foundation/nscalendar/date(bysettingunit:value:of:options:).md)
- [date(era:year:month:day:hour:minute:second:nanosecond:)](foundation/nscalendar/date(era:year:month:day:hour:minute:second:nanosecond:).md)
- [nextWeekendStart(_:interval:options:after:)](foundation/nscalendar/nextweekendstart(_:interval:options:after:).md)
