# Determine date range given year and week number

**URL:** <https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878>\
**Category:** General Usage\
**Tags:** question, dates, standard-lib\
**Created:** [February 1, 2023, 4:49pm UTC](https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878 "2023-02-01T16:49:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [February 2, 2023, 4:06am UTC](https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878/7 "2023-02-02T04:06:43Z")

</div>

Is it helpful? (if so, it deserves some testing)

```julia
function firstmondayofISOyear(year)
  date = Date(Year(year))
  firstthursdayofyear = firstdayofweek(date) + Day(3)
  yr = Year(firstthursdayofyear).value
  if yr < year
    firstthursdayofyear += Day(7)
  end
  firstthursdayofyear - Day(3)
end

```

also

```julia
help?> Dates.week
  week(dt::TimeType) -> Int64

  Return the ISO week date
  (https://en.wikipedia.org/wiki/ISO_week_date) of a Date or DateTime
  as an Int64. Note that the first week of a year is the week that
  contains the first Thursday of the year, which can result in dates
  prior to January 4th being in the last week of the previous year. For
  example, week(Date(2005, 1, 1)) is the 53rd week of 2004.

  Examples
  ≡≡≡≡≡≡≡≡

  julia> week(Date(1989, 6, 22))
  25

  julia> week(Date(2005, 1, 1))
  53

  julia> week(Date(2004, 12, 31))
  53

```

---

_[View the full topic](https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878)._
