java Calendar.DAY_OF_WEEK 周一
时间: 2023-09-16 19:16:15 浏览: 266
在Java中,使用Calendar类的get方法可以获取指定日期的星期几,其中Calendar.DAY_OF_WEEK代表周几,取值范围为1-7,其中1代表周日,2代表周一,以此类推。通过获取当天的Calendar实例后调用get(Calendar.DAY_OF_WEEK)方法即可获得当天是星期几。根据给定的代码和日期"2016-01-04",可以得到结果为2,表示该日期为周一。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [DB2或MySql的week_iso或weekOfYear()与java的Calendar.WEEK_OF_YEAR保持一致](https://blog.csdn.net/lm350446407/article/details/74936772)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Java Calendar.add方法代码示例](https://blog.csdn.net/weixin_34268604/article/details/112040150)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文