六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 35|回复: 0

根据You 传过来的year month,you can catch this month all day

[复制链接]

升级  32.45%

533

主题

533

主题

533

主题

探花

Rank: 6Rank: 6

积分
1649
 楼主| 发表于 2013-2-1 09:44:41 | 显示全部楼层 |阅读模式
/**
* 根据Y传过来的year month,y can catch this month all day
* @param year
* @param month
* @return
*/
public static String [] getAll_Year_Month(int year,int month)
{
SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH,month-1); //注意这一块
int len =c.getActualMaximum(Calendar.DATE);
String[] st = new String[len];
for(int i=0; i<st.length; i++)
{
c.set(Calendar.DATE,i+1);
st[i]=sim.format(c.getTime());
}
return st;
}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表