当前位置:网站首页>根据年份获取第一天和最后一天
根据年份获取第一天和最后一天
2022-06-23 16:08:00 【susu1083018911】
/**
* 获取某年第一天日期
* @param year 年份
* @return Date
*/
public Date getFirstOfYear(int year){
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
return calendar.getTime();
}
/**
* 获取某年最后一天日期
* @param year 年份
* @return Date
*/
public Date getLastOfYear(int year){
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.YEAR, year);
calendar.roll(Calendar.DAY_OF_YEAR, -1);
return calendar.getTime();
}边栏推荐
- Amadis发布OLA支付处理标准
- ASEMI超快恢复二极管ES1J参数,ES1J封装,ES1J规格
- JS常见的报错及异常捕获
- Focus: zk-snark Technology
- 电感参数有哪些?怎么选择电感?
- ADC digital DGND, analog agnd mystery!
- ASEMI肖特基二极管和超快恢复二极管在开关电源中的对比
- Network remote access raspberry pie (VNC viewer)
- Short video platform development, click the input box to automatically pop up the soft keyboard
- 公司招了个五年经验的测试员,见识到了真正的测试天花板
猜你喜欢

JS常见的报错及异常捕获

二分查找法思路分析

Jetpack Compose 与 Material You 常见问题解答

The official Chinese course of zero foundation introduction jetpack compose is coming

图扑数字孪生 3D 风电场,智慧风电之海上风电

golang冒泡排序代码实现

Code implementation of golang binary search method

Implementation of golang bubble sort code
![Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]
![Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]
随机推荐
R语言ggplot2可视化水平箱图(Horizontal boxplot with coord_flip)、并添加抖动数据点显示分布情况(jittered points)
leetcode:30. 串联所有单词的子串【Counter匹配 + 剪枝】
供求两端的对接将不再是依靠互联网时代的平台和中心来实现的
ABAP essays - program optimization notes
Counter attack by flour dregs: MySQL 66 question! Suggested collection
npm install 问题解决(nvm安装与使用)
What are the inductance parameters? How to choose inductance?
What are the risks of opening a fund account? Is it safe to open an account
Comparison of asemi Schottky diode and ultrafast recovery diode in switching power supply
Now I want to buy stocks. How do I open an account? Is it safe to open a mobile account?
Short video platform development, click the input box to automatically pop up the soft keyboard
Golang对JSON文件的读写操作
Why do we say that the data service API is the standard configuration of the data midrange?
图扑数字孪生 3D 风电场,智慧风电之海上风电
Leetcode 450. Delete node in binary search tree
使用Jmeter进行性能测试及性能监控平台搭建
什么是抽象类?怎样定义抽象类?
Jetpack Compose 与 Material You 常见问题解答
【历史上的今天】6 月 23 日:图灵诞生日;互联网奠基人出生;Reddit 上线
Coatnet: marrying revolution and attention for all data sizes