Questions tagged «week-number»


23
从星期数计算日期
任何人都知道一种获取一周中第一天(在欧洲的星期一)的简单方法。我知道年份和星期几吗?我将在C#中执行此操作。
135 c#  .net  week-number 

18
从周号获取周开始日期和周结束日期
我有一个查询,该查询计算数据库中成员的结婚日期。 SELECT SUM(NumberOfBrides) AS [Wedding Count] , DATEPART( wk, WeddingDate) AS [Week Number] , DATEPART( year, WeddingDate) AS [Year] FROM MemberWeddingDates GROUP BY DATEPART(year, WeddingDate), DATEPART(wk, WeddingDate) ORDER BY SUM(NumberOfBrides) DESC 在结果集中表示每周的开始和结束时如何计算? SELECT SUM(NumberOfBrides) AS [Wedding Count] , DATEPART(wk, WeddingDate) AS [Week Number] , DATEPART(year, WeddingDate) AS [Year] , ??? …

5
如何在Java中查找一年的总周数?
我正在做一个项目。我应该在那里找到一年的总周数。我尝试使用以下代码,但得到的答案是错误的:2020年有53周,但是这段代码却有52周。 这段代码在哪里出错了? package com.hib.mapping; import java.time.LocalDate; import java.time.temporal.WeekFields; import java.util.Calendar; import java.util.GregorianCalendar; import org.joda.time.DateTime; public class TestWeek { public static void main(String args[]) { System.out.println(getWeeks()); } public static int getWeeks() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2020); cal.set(Calendar.MONTH, Calendar.JANUARY); cal.set(Calendar.DAY_OF_MONTH, 1); GregorianCalendar gregorianCalendar = new GregorianCalendar(); int weekDay = cal.get(Calendar.DAY_OF_WEEK) …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.