Current Calendar Week Number

Current week of year! Always looking up the current calendar week number? No Problem. Here it is! Find the calendar week numbers for the next years. Check dates, timestamps and daylight saving time of weeks.



Calendar Week 40 in 2022

Mon. 2022-10-03 — Sun. 2022-10-09


Week 40 of Year 2022

Week Number40
StartsMon. 2022-10-03
EndsSun. 2022-10-09
Your TimezoneAmerica/New_York
Timezone OffsetEDT (-04:00)
Daylight SavingYes (2022-10-03)
TimestampsFrom 1664769600 to 1665374399
ISO 8601 Week2022W40
ISO 8601 Year / Week2022 / 40
Set DateMon. 2022-10-03
All weeks of 2022: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

About Week Numbers

Weeks in a Gregorian calendar year can be numbered for each year. This style of numbering is often used in European and Asian countries. It is less common in the U.S. and elsewhere.

The system for numbering weeks is the ISO week date system, which is included in ISO 8601. This system dictates that each week begins on a Monday and is associated with the year that contains that week's Thursday.

More on Wikipedia: Week Numbering


First week of year - Week W01

The first week is the week with the starting year's first Thursday in it (the formal ISO definition). There are some other definitions with the same result: The week with 4 January in it, the first week with the majority (four or more) of its days in the starting year or the week starting with the Monday in the period 29 December - 4 January.

Week 1 (W01) of 2022 goes from 2022-01-03 to 2022-01-09.

More on Wikipedia: ISO 8601


Last week of year - Week W52

28. December is always in the last week of its year. The week number can be described by counting the Thursdays: week 12 contains the 12th Thursday of the year.

Week 52 (W52) of 2022 goes from 2022-12-28 to 2023-01-03.

More on Wikipedia: ISO 8601


Current Week Numbers in Different Programming Languages

Current Week number in PHP
$week = date('W');
Week number from Date in PHP
$localDate = new \DateTime();
$localDate->setISODate(2022, 40);
$localDate->setTime(0, 0);
Javascript Current Week
Date.prototype.getWeek = function () {

    var target = new Date(this.valueOf());
    var dayNr = (this.getDay() + 6) % 7;

    target.setDate(target.getDate() - dayNr + 3);

    var firstThursday = target.valueOf();
    target.setMonth(0, 1);

    if (target.getDay() !== 4) {
        target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7);
    }

    return 1 + Math.ceil((firstThursday - target) / 604800000);
}

var aDate = new Date('2022-10-01');
alert(aDate.getWeek()); // Result: 40

Current Week in Python
from datetime import date
weekNumber = date.today().isocalendar()[1]
Calendar Week in Java
Calendar calendar = new GregorianCalendar();
calendar.set(2022, 10, 1);
int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR); // Result: 40
Current Week with MySQL
SELECT WEEKOFYEAR(NOW());
SELECT WEEKOFYEAR('2021-01-02');
Current Week with GO
import "fmt"
import "time"

var timeNow := time.Now()
var _, wkNum := timeNow.ISOWeek()
Current Week with C
#include 
#include 

int main()
{
    time_t rawtime;
    struct tm * timeinfo;
    char buffer [80];

    time (&rawtime);
    timeinfo = localtime (&rawtime);

    strftime (buffer,80,"Week: %U",timeinfo);
    puts (buffer);

    return 0;
}
Current Week with C#
using System;
using System.Globalization;

public class SamplesCalendar  {
   public static void Main()  {
      CultureInfo myCI = new CultureInfo("en-US");
      Calendar myCal = myCI.Calendar;

      CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
      DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;

      Console.WriteLine( "Week: {0}", myCal.GetWeekOfYear( DateTime.Now, myCWR, myFirstDOW ));
   }
}