获取今后多少天后的日期
来源:互联网 发布:阿里云搭建网站全过程 编辑:程序博客网 时间:2024/06/11 00:50
获取今后多少天后的日期
/** * Get the date some days later. * @param year the year * @param month month of the year * @param day day of the month * @return if the parameter is illegal this will return null */@SuppressLint("SimpleDateFormat")private static String getClosingDate(int year, int month, int day) { final int internalDay = 31; final String pattern = "yyyy-MM-dd"; DateFormat dateFormat = new SimpleDateFormat(pattern); Date closingDate; try { Calendar thisDay = Calendar.getInstance(); thisDay.set(Calendar.YEAR, year); thisDay.set(Calendar.MONTH, month - 1);// the first month of the year is 0. thisDay.set(Calendar.DAY_OF_MONTH, day); thisDay.add(Calendar.DAY_OF_MONTH, internalDay); closingDate = thisDay.getTime(); } catch (Exception e) { e.printStackTrace(); return null; } return dateFormat.format(closingDate);}
- 邮箱 :charon.chui@gmail.com
- Good Luck!
0 0
- 获取今后多少天后的日期
- js获取n天后的日期
- 获取当前日期加day天后的日期
- JS获取当前日期指定天后的日期
- Java如何把字符串表示的日期按要求变为多少天前,多少天后
- 获取当前日期XX天后的日期 获取当前日期XX月后的日期
- 获取N天前的日期和N天后的日期
- 时间操作(Java版)—获取给定日期N天后的日期
- SAP HANA SQL获取当前日期加若干天后的日期
- Java获取N天前,N天后的日期(如3天)
- 时间操作(Java版)—获取距离系统时间N天后的日期时间信息
- JS 获取n天后的日期(返回Y-m-d字符串格式)
- iOS 获取当前和当前n天后的日期(n为负数表示往前)
- java计算30天后的日期源码
- iOS当前日期n天后的date
- 计算1千天后的日期
- linux获取当前日期多少天前的日期
- 给定一个日期,求N天后(前)的日期
- 单例的最佳实现方式
- 水葫芦的利用价值
- 【c语言】实现strchr
- 7、学习线程
- Vim打开多个文件
- 获取今后多少天后的日期
- 关于数据库的性能优化措施
- 强引用、软引用、弱引用、虚引用
- OC基础使用(七 NSMutableArray 可变数组)
- java自学笔记————反射常用的方法和对象;
- 阿里云Ubuntu 12.4 64位 安装docker
- 百钱买百鸡问题(附java源代码)
- 【BZOJ2298】【HAOI2011】problem a 动态规划
- C语言实现控制台输出背景颜色字体颜色变化