如何得到一具体时间的该月的天数 没有办法,自己用calendar帮助写一个吧。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static int getDaysOfMonth(Calendar ca){ ca.set(Calendar.DAY_OF_MONTH,1); ca.add(Calendar.MONTH,1); ca.add(Calendar.DAY_OF_MONTH,-1); ca.getTime(); return ca.get(Calendar.DAY_OF_MONTH);} 用他的自带的函数,也就是calendar. Calendar cal = Calendar.getInstance();cal.setTime(new Date());System.out.println(cal.get(Calendar.DAY_OF_MONTH));System.out.println(cal.getActualMaximum(Calendar.DAY_OF_MONTH)); 一小关羽求质数的程序 求人帮忙解释下 JTree dom4j 重写 getTreeCellRendererComponent时的问题 struts-bean.tld,struts-html.tld,struts-logic.tld 请教 一个文件打印输出的简单问题请教......... 如何用File遍历网络路径? 如何让 textArea 自动换行?? C语言到Java的代码转换,难!!! eclipse的简单配置问题 java程序将dos文本与unix文本互转 Java板块人气明显不够旺!让我们一起来...... 关于垃圾收集的问题,诸位大哥帮帮忙 关于数组的问题
ca.set(Calendar.DAY_OF_MONTH,1);
ca.add(Calendar.MONTH,1);
ca.add(Calendar.DAY_OF_MONTH,-1);
ca.getTime();
return ca.get(Calendar.DAY_OF_MONTH);
}
cal.setTime(new Date());
System.out.println(cal.get(Calendar.DAY_OF_MONTH));
System.out.println(cal.getActualMaximum(Calendar.DAY_OF_MONTH));