Based on Gregorain calendar, every week of a year has a number from 1 to 52, 53 or 54. Use this tag for instance if you want to calculate the weeknumber from a certain date or vice versa. You also might include the date tag. This tag is independent of programming language.
Questions tagged [week-number]
603 questions
3
votes
1 answer
Week-number in PHP, again
We are using the ISO 8601-standard to show week numbers here in Sweden. Most people seems to be confused about this standard that week 1 can be in the former year. I am aware of this.
I have different strange problem, every date on a Monday is…

jannej
- 864
- 14
- 26
3
votes
2 answers
How to get "start date" and "end date" of a week from MYSQL when week number is available?
The week() function of MySql gives number of week from 0-53.
I have a weeknumber and I want to have the "start date" and "end date" of the week represented by weeknumber. How can I do that?
If there is no way of getting "start date" and "end date"…

Saswat
- 12,320
- 16
- 77
- 156
3
votes
0 answers
Get fiscal week of year from date using SQLite query
I have used the below the SQLite query to find week of year for Calendar(Jan-Dec).
"SELECT STRFTIME('%W' ,[Orders].[OrderDate] ) AS [Grid_Column_0],SUM([Orders].[Freight]) AS [Grid_Column_1] FROM [Orders] AS [Orders] GROUP BY STRFTIME('%W'…

Kavitha M
- 263
- 1
- 7
- 23
3
votes
1 answer
How to get week number and year from date in R
I am trying to get both week number and year from a date object in R.
Until then, I did it separately : I used isoweek() function to extract week and year() function to extract year. So that my data.frame has 3 variables : date, week, year
This is…

Lili
- 55
- 1
- 2
- 10
3
votes
3 answers
Moment.js : Get first day of first week by given year
Im trying to get the first day of first week by given day
Correct results :
2017 = 2 Jan (Monday)
2016 = 4 Jan (Monday)
2015 = 1 Jan (Thursday)
2014 = 1 Jan (Wednesday)
2013 = 1 Jan (Tuesday)
I can get the first day of the year by…

l2aelba
- 21,591
- 22
- 102
- 138
3
votes
4 answers
Java Time: Get max number of weeks for particular year
I only found a solution for Joda Time.
My solution works only if the last day is not in the first week:
LocalDate.now() // or any other LocalDate
.withDayOfMonth(31)
.withMonth(12)
.get(weekFields.weekOfWeekBasedYear())
So what is the correct…

pme
- 14,156
- 3
- 52
- 95
3
votes
1 answer
In Python how can I get a date based on a year, week number & weekday?
Given a date value and a number, I want to see how that number compares to the one for the equivalent day on preceding years.
For 'equivalent day', I mean the same week number and the same weekday, NOT the same calendar date.
For example, starting…

Jeremy Jones
- 4,561
- 3
- 16
- 26
3
votes
1 answer
Year-Week-Day in java.time?
Is there support in the java.time classes, or its extension ThreeTen-Extra, for a week dates, specifically a Year-Week-Day such as 2009-W53-7 which is Sunday 3 January 2010.
As for the year-week without the day-of-week:
My Answer to the Question,…

Basil Bourque
- 303,325
- 100
- 852
- 1,154
3
votes
3 answers
ISO week number in VBScript or VBA
How can I get the ISO week number of some date in VBScript or VBA?

Michel de Ruiter
- 7,131
- 5
- 49
- 74
3
votes
2 answers
PHP date: week numbers for 2015/2016
As stated in ISO 8601 there are years that will have 53 weeks, 2015 is one of those. What will be the next week number in 2016? Does it start with week 01 again? The reason I am asking is that in one of my projects an URL "2016-W01" does show the…

marcmueller
- 43
- 4
3
votes
2 answers
Year-Week add a week in r
I have a dataframe with a column containing Date and time, and I have created a new column containing Year-Week with this formula,
Path LogTime
HJH 2015-06-19 01:57:11
GTF 2015-07-31 08:23:34
R 2015-07-21…

KhalidN
- 385
- 1
- 7
- 13
3
votes
4 answers
Get week number for different startdate
I can get week number if I use normal way like that. As you know this one calculates week number according to normal start date which is 01.01.2015.
CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(mydate,…

Kadir
- 3,094
- 4
- 37
- 57
3
votes
3 answers
Is there a way in javascript to create a date object using year & ISO week number?
I am trying to create a google annotated timeline viz. For that I need to input the date of the event. The only information I have is the year & the ISO week number for the event. Is there a way in Javascript to create a Date object using just the…

Chantz
- 5,883
- 10
- 56
- 79
3
votes
2 answers
Incorrect weeks calculation in momentjs
I use node.js with moment 2.9.0
var moment = require("moment");
var d = moment.utc([2014, 11, 27]);
var iso = d.toISOString();
var week = d.week();
shows iso = "2014-12-27T00:00:00.000Z"
and week is 52.
But if var d = moment.utc([2014, 11,…

Ilya
- 71
- 1
- 7
3
votes
1 answer
how to groupBy dates of JSON data with help of Underscore.js library?
I have following JSON data:
var data = [
{ "allocated":"20", "unallocated":"2", "day":"01/01/2014" },
{ "allocated":"12", "unallocated":"0", "day":"02/01/2014" },
{ "allocated":"2", "unallocated":"18", "day":"03/01/2014" },
{…

BomberMan
- 1,094
- 3
- 13
- 33