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
5
votes
2 answers
VB.NET DatetimePicker - Wrong week number
I have an issue with my vbnet extented datetime picker.
When the element pass to new year (2016), the week number displayed on the left is wrong.
I have a "datetimepicker" which is not the default component, it was downloaded here :…

user2839159
- 443
- 3
- 6
- 17
5
votes
2 answers
SQL Server - Get first date in a week, given the week number?
I've got a query (for use in bug tracker.net) that calculates the number of bugs by week by status. But the query returns the week number, what I really want is the first date of the week
select datepart(wk, DateAdd(day, 0, DateDiff(day, 0,…

JK.
- 21,477
- 35
- 135
- 214
5
votes
2 answers
Incorrect ISO8601 Week Number using DatePart()
I have the following Sub within my class. I have no errors but the results do not match ISO-8601 standards
Private Sub calculateAllProperties(ByVal dt As Date)
Select Case dt.DayOfWeek
Case DayOfWeek.Monday
…

Mych
- 2,527
- 4
- 36
- 65
5
votes
1 answer
What settings in Mac OS X affect the `Locale` and `Calendar` inside Java?
These two questions prompted me to wonder what settings in Mac OS X affect the Locale and Calendar defaults and behavior in Java:
WEEK_OF_YEAR inconsistent on different machines
Why would Calendar.getInstance() fail to use the default locale?
Key…

Basil Bourque
- 303,325
- 100
- 852
- 1,154
5
votes
2 answers
Representing week of year with Joda-Time
What is the best way to represent week of year with Joda-Time library? I'm looking something as elegant as YearMonth is for representing month of year.

michal.kreuzman
- 12,170
- 10
- 58
- 70
4
votes
1 answer
Get Week and Year in Past Using LocalDate
I'm using the Java 8 time library to determine the previous weeks and year from today's date and then store those values in a map. I think I've figured out how to properly get the weeks, but I'm not entirely sure what the correct way is to get the…

Pr0pagate
- 199
- 2
- 12
4
votes
1 answer
Getting the week number for a date (week starting on Wednesday)
LocalDate initial = LocalDate.now();
DayOfWeek dayOfWeek = DayOfWeek.WEDNESDAY;
WeekFields weekFields = WeekFields.of(dayOfWeek, 1);
int weekNo = date.get(weekFields.weekOfWeekBasedYear());
System.out.println("Week No"+weekNo);
I am using the above…

Mahendra
- 3,647
- 2
- 16
- 16
4
votes
1 answer
Given an ISO 8601 week number, get date of first day of that week in LibreOffice Calc spreadsheet
LibreOffice Calc spreadsheet offers a function ISOWEEKNUM to return the standard ISO 8601 week number of the specified date.
I want the opposite.
➠ Given a standard week number, give me the date of the first day of that week (the Monday date).…

Basil Bourque
- 303,325
- 100
- 852
- 1,154
4
votes
1 answer
PostgreSQL custom week number - first week containing Feb 1st
I'm new to SQL functions and trying to create a calendar table that displays custom week numbers, with each week starting with Saturday and ending on Friday. The first week of each year always contains Feb.1st of that year.
For example, if the day…

Sheena Yu
- 43
- 4
4
votes
3 answers
Can someone explain how date("YW", strtotime("2016-01-02")); returns “201653”?
date("YW", strtotime("2016-01-02")); returns “201653”
Year is OK
Week is from 2015

Boaz Yahav
- 169
- 2
- 11
4
votes
1 answer
How to get week beginning date in DB2?
Using DB2, without a calendar lookup, How do I determine the Sunday of the week to which a certain date belongs? For example, give a set of dates:
date
----------
2015-05-01
2015-05-02
2015-05-03
2015-05-04
2015-05-05
2015-05-06
2015-05-07
how do I…

shecode
- 1,716
- 6
- 32
- 50
4
votes
4 answers
Flex, how to get week of year for a date?
I could not find a method in Flex Date object to get the week of year (1 to 52)
What is the best way to find this? Is there any useful library for flex for such date operations like JodaTime in Java.

enesness
- 3,123
- 5
- 31
- 33
4
votes
1 answer
Joda time week calculation reasoning
The code below demonstrates the problematic joda-time implementation of week calculation. This behavior is not a bug but a design decision Joda-Time uses the ISO standard Monday to Sunday week. (perhaps it should be a bug?)
Given a date I need to…

Maxim Veksler
- 29,272
- 38
- 131
- 151
4
votes
2 answers
Get week number using date in python
Date is datetime.date(2013, 12, 30)
I am trying to get week number using
import datetime
datetime.date(2013, 12, 30).isocalendar()[1]
I am getting output as ,
1
Why i am not getting week number of last year , instead i am getting week number of…

Nishant Nawarkhede
- 8,234
- 12
- 59
- 81
4
votes
2 answers
Calendar.getActualMaximum(Calendar.WEEK_OF_YEAR) weirdness
Either I don't understand the method getActualMaximum(int) or the field WEEK_OF_YEAR, or there's a Sun bug involved (or all three)...could someone explain to me why (at least in a German locale...) the following code:
Locale.setDefault(…

Epaga
- 38,231
- 58
- 157
- 245