Total number of weeks in year

mikzielinski
mikzielinski Registered Posts: 3 ✭✭✭

Hi all,

How can I get a number of weeks in the year based on date?

Answers

  • Liev
    Liev Dataiker Alumni Posts: 176 ✭✭✭✭✭✭✭✭

    Hi @mikzielinski

    Just to confirm I understand correctly. Are you looking for:

    1. The number of weeks in a year, given a year as a parameter? This would be equivalent to asking whether a year is a leap year.
    2. Given a date, compute the week within the year that that date falls on. This would return an integer.

    Let me know!

  • mikzielinski
    mikzielinski Registered Posts: 3 ✭✭✭

    I manage to get this,

    From the date I got the current week number, then I created a fake date on last week of the year. After that, I subtracted them and got weeks until the end of year

Setup Info
    Tags
      Help me…