java中的日期
来源:互联网 发布:崛起平台网络兼职 编辑:程序博客网 时间:2024/04/28 16:39
Date now = new Date(time);
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis()+999L*24*60*60*1000);
//cal.setTimeInMillis(time);//以毫秒为单位设置时间
System.out.println(cal);
System.out.println(cal.get(1));//获得年
System.out.println(cal.get(2)+1);//月
System.out.println(cal.get(5));//日
System.out.println(cal.get(11));//时?待验证
System.out.println(cal.get(12));//分?待验证
System.out.println(cal.get(13));//秒?待验证
//SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
//String str = sdf.format(now);
//System.out.println(str);
System.out.println(now.getYear()+1900);
System.out.println(now.getMonth()+1);
System.out.println(now.getDate());
System.out.println(now.getHours());
System.out.println(now.getMinutes());
System.out.println(now.getSeconds());
- Java中的日期处理
- Java中的日期处理
- java中的日期处理
- java中的日期转换
- java中的日期操作
- Java中的日期类
- JAVA中的日期、日历
- JAVA中的日期
- java中的日期处理
- java 中的日期处理
- JAVA中的日期计算
- JAVA中的日期格式化
- Java中的日期类型
- java中的日期类
- java中的日期
- java中的日期处理
- Java中的日期时间
- java mysql中的日期
- OpenCV之imgproc 模块. 图像处理(2)实现自己的线性滤波器 给图像添加边界 Sobel 导数 Laplace 算子 Canny 边缘检测
- 投影坐标系 X和Y坐标的位数
- JNI error:libEGL: call to OpenGL ES API with no current context (logged once per
- HDOJ 2027 统计元音
- fudanNLP(fnlp)添加自定义字典
- java中的日期
- OpenCV之imgproc 模块. 图像处理(3)霍夫线变换 霍夫圆变换 Remapping 重映射 仿射变换
- LeetCode 315. Count of Smaller Numbers After Self (逆序数对)
- 实参与形参的传递关系
- shell脚本中一些特殊符号
- 235. Lowest Common Ancestor of a Binary Search Tree
- Nginx设置虚拟主机,添加多站点
- QT - OpenCV的安装与配置(转载)
- OpenCV之imgproc 模块. 图像处理(4)直方图均衡化 直方图计算 直方图对比 反向投影 模板匹配