Function

GLib-2.0GLibdate_get_weeks_in_yearSince 2.86

  • Calculates the number of weeks in the year.

    The result depends on which day is considered the first day of the week, which varies by locale. first_day_of_week must be valid.

    The result will be either 52 or 53. Years always have 52 seven-day periods, plus one or two extra days depending on whether it’s a leap year. This function effectively calculates how many first_day_of_week days there are in the year.

    Parameters

    Returns number

    the number of weeks in year

    2.86