久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY),它會

Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY), will it roll backwards, forwards or unknown?(Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY),它會向后滾動,向前滾動還是未知?) - IT屋-程序員軟件開發技術
本文介紹了Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY),它會向后滾動,向前滾動還是未知?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

假設以下代碼在 2009 年 8 月 22 日(星期六)執行

Suppose the following code is executed on the 22nd of August 2009 (a Saturday)

   Calendar c = Calendar.getInstance();
   c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);

c.get(Calendar.DAY_OF_MONTH) 將返回 23.我感興趣的條件是返回 14(上周日,而不是下周日).

c.get(Calendar.DAY_OF_MONTH) will return 23. I'm interested in the conditions is would return 14 (last Sunday, rather than the next Sunday).

當設置 DAY_OF_WEEK 時,是否有任何與日歷滾動 DAY_OF_MONTH/YEAR 的方向相關的規則?如果有,它們是什么?

Are there any rules associated with the direction Calendar will roll the DAY_OF_MONTH/YEAR when DAY_OF_WEEK is set? If so what are they?

推薦答案

應該始終保持相同的WEEK_OF_MONTH (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#WEEK_OF_MONTH).來自文檔:

It should always keep the same WEEK_OF_MONTH (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#WEEK_OF_MONTH). From the documentation:

當設置或獲取WEEK_OF_MONTH 或 WEEK_OF_YEAR 字段,日歷必須確定第一周作為參考的月份或年份觀點.一個月的第一周或年份被定義為最早的七個日期間開始于getFirstDayOfWeek() 并包含在最少 getMinimalDaysInFirstWeek() 天那個月或那個年.周數..., -1, 0 在第一周之前;第 2 周、第 3 周、... 跟隨它.請注意,標準化編號get() 返回的可能不同.例如,特定的日歷子類可以指定前一周一年的第 1 周作為第 n 周上一年.

When setting or getting the WEEK_OF_MONTH or WEEK_OF_YEAR fields, Calendar must determine the first week of the month or year as a reference point. The first week of a month or year is defined as the earliest seven day period beginning on getFirstDayOfWeek() and containing at least getMinimalDaysInFirstWeek() days of that month or year. Weeks numbered ..., -1, 0 precede the first week; weeks numbered 2, 3,... follow it. Note that the normalized numbering returned by get() may be different. For example, a specific Calendar subclass may designate the week before week 1 of a year as week n of the previous year.

這篇關于Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY),它會向后滾動,向前滾動還是未知?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當前星期幾的值)
主站蜘蛛池模板: 亚洲一区二区黄 | 久久久久国产一区二区三区 | 久久久久国产一区二区三区四区 | 日本一区二区高清视频 | 一区二区三区视频播放 | 久久精品国产精品青草 | 亚洲精品国产成人 | 国产精品久久久久久久久久免费 | 国产99在线 | 欧美 | 三级成人在线 | 91人人在线 | 久久伦理中文字幕 | 久久综合狠狠综合久久综合88 | 国产一级特黄真人毛片 | 在线日韩欧美 | 亚洲永久精品国产 | 久色视频在线 | 色先锋影音 | 成人午夜av | 亚洲精品视频在线观看免费 | 免费观看一级特黄欧美大片 | 亚洲毛片在线观看 | 精品一区二区三区四区在线 | 一区二区三区四区在线 | 午夜在线观看视频 | 午夜成人免费视频 | 午夜精品一区二区三区三上悠亚 | 欧美精品一区二区在线观看 | 一本色道久久综合亚洲精品高清 | 男女视频免费 | 男人天堂久久久 | 免费超碰| 男人天堂手机在线视频 | 日韩福利在线观看 | 在线观看国产视频 | 欧美精品在线播放 | 欧美一区二区在线免费观看 | 在线观看特色大片免费网站 | 影音先锋欧美资源 | 亚洲精品视| 视频一区在线观看 |