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
0
votes
0 answers
Different week no. returned using DateTimeFormatter YYYY-w & by DateTimeFormatter.ISO_WEEK_DATE Java8
I am trying to format the milliseconds date from sample milliseconds value-1451646394000 to get the week number.
Following is the code snippet:
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import…

user4593933
- 11
- 1
- 3
0
votes
0 answers
SQL Server : set weeknumber fiscal year
I have a stored procedure that creates a calendar table that spans many years for my financial reports, example the years run from 01/06/2015 to 31/05/2016. I want to change the weeknumber calculation so that it starts counting the weeks from the…

w00t
- 29
- 7
0
votes
2 answers
Excel weeknum function showing wrong week number?
I have a workbook:
Column A Column B
01/01/2017 =WEEKNUM(A2,2)
26/01/2017 =WEEKNUM(A3,2)
I am trying to get the week number starting monday.
Excel gives me this:
01/01/2017 1
26/01/2017 1
Both dates cannot have a week…

user7415328
- 1,053
- 5
- 24
- 61
0
votes
1 answer
PowerBI - Week Number on X-Axis
I have a line graph in PowerBI and in my date dimension I have the Week Number for every date (note that this is a custom week number with the week starting on Friday).
Whenever I put it on a the x-axis, PowerBI groups all the weeks together,…

SUMguy
- 1,505
- 4
- 31
- 61
0
votes
3 answers
PHP: Loop through all weeks in a date range (last 2 years)?
I like to iterate through all weeks in a date range that spawns 2 years. Starting at the current week number two years ago, until the current week number this year.
The problem is that a year can either have 52 weeks or 53 weeks, for example:
2015…

Pascal Klein
- 23,665
- 24
- 82
- 119
0
votes
1 answer
R strptime Monday date from weeknumber weird
I am making a trivial error here but cannot get my head around figuring out what is the problem.
I need to get the date of the Monday of the week of a random date.. Seems I am getting something quite different
mydate <-…

juhariis
- 568
- 8
- 15
0
votes
1 answer
Cakephp 3 i18nFormat string for the number of weeks in a specified date
How to get number of week for specific date in cakephp 3?
$this->mydate->i18nFormat('yyyy-MM-dd') will display year-month-date.
But what about string format for week number?
Thanks.

Yosi Azwan
- 497
- 4
- 15
0
votes
1 answer
Get Normal Week number from Jquery UI datepicker
I am trying to get week number(1,2,3,4,5) with in the month from Jquery UI datepicker. I googled and get the code of iso8601Week but not normal week number.
Kindly Help

user375947
- 130
- 12
0
votes
1 answer
GetWeekOfYear returns the wrong week number
I tried this code on three different machines and I keep getting 28 for today's week number:
Dim myCI As New CultureInfo("en-US")
Dim myCal As System.Globalization.Calendar = myCI.Calendar
Dim myCWR As CalendarWeekRule =…

augustogmaraujo
- 1
- 2
0
votes
1 answer
Handsontable datepicker week number modification
Hello i am using the Handsontable library and i have a problem.
I cant find anyway to configure the date Picker to start counting after the first Thursday of the year.
As a result i get a week more than i should.
I get week 27 instead of week 26 for…

JustVF
- 1
0
votes
1 answer
Week Number Type in Google Trends
This is probably a very basic question
I have downloaded a Google trends file and the date range for each row is a week format similar to 2004-01-04 - 2004-01-10. This is basically Sun to Sat
Pseudo Code here where the Week is equal to the format…

John Smith
- 2,448
- 7
- 54
- 78
0
votes
1 answer
Assigning an ID vector to a dataframe in R, based on week number (ISOweek)
I'm trying to add ID codes to a dataframe (creel), which is a time series of shellfish landings from 2000 to 2015. The first few columns are given below:
head(creel,10)
week year boat fID
1 2000-W01 2000 Mousa NA
…

Mark H
- 43
- 6
0
votes
2 answers
Teradata Week Calculation
I have a query in teradata where i am trying to get the week number from a specific date in the format yyyymmdd (20160201). We have a calendar table (not the teradata one because we count weeks slightly differently) which allows you to join the date…

John Smith
- 2,448
- 7
- 54
- 78
0
votes
3 answers
SQL - Day of the week issue on select
I have a problem with a query....
I have a this query:
declare @today int
set @today=DATEPART(dw,GETDATE())-2
select cast (cfv.value as VARCHAR), cfv.companyId
from CompanyFieldvalues cfv
join CompanyFields cf on…

Carlo 1585
- 1,455
- 1
- 22
- 40
0
votes
2 answers
Group entries per week where each column got specific date validation
I am trying to group tickets per week in a year when data field X are between that week. The final result should be something like Week,Datefield1,Datefield2..
What I reached so far:
DECLARE @YearStartDate datetime
SET @YearStartDate = '2016-01-04…

Rafael Cardoso
- 121
- 1
- 1
- 9