今天是哪一天Oct 24, 2011.
但使用此代码
Calendar currentDate = Calendar.getInstance();
int d = currentDate.DAY_OF_MONTH;
Run Code Online (Sandbox Code Playgroud)
给了我约会 5
PS模拟器设置中的日期是 October 24, 2011
Jig*_*shi 12
currentDate.DAY_OF_MONTH;
Run Code Online (Sandbox Code Playgroud)
是在Calendar类内部使用的常量.获取当月的使用日期
使用
currentDate.get(Calendar.DAY_OF_MONTH);
Run Code Online (Sandbox Code Playgroud)
更新:
如何将当前日期转移6天,并获得新的日期和月份值?//添加6天currentDate.add(Calendar.DATE,6);
//retrieving the month now, note month starts from 0-Jan, 1-Feb
currentDate.get(Calendar.MONTH);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1497 次 |
| 最近记录: |