获取系统年月日
2016-07-05 14:51
155 查看
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //Date d = sdf.parse("2011-10-20"); Calendar c = Calendar.getInstance(); //c.setTime(d); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH) + 1; int day = c.get(Calendar.DAY_OF_MONTH); System.out.printf("year=%04d, month=%02d, day=%02d\n", year, month, day);
相关文章推荐
- ZigZag Conversion(python)
- NuSOAP webservice接口使用详解
- 画布平铺
- QT signal & slot 定义及用法
- coreseek安装遇到的错误
- Count of Smaller Number After Itself
- iptables 配置
- delete表1条件是另一个表中的数据,多表连接删除(转)
- 关于bootstrap单页面中多Modal的问题
- PostMessaget ON_MESSAGE
- Oracle中序列详解
- 华为机试---求int型数据在内存中存储时1的个数
- ajax无刷新上传
- 200. Number of Islands
- nginx配置笔记
- HDOJ 5194 DZY Loves Balls
- 网站标签页显示自定义图标
- SRP
- oralce数据导入遇到 imp错误IMP-00058: IMP-00000: 未成功终止导入
- iOS中处理计算精度要求很高的数据