package fourth;import java.text.DateFormatSymbols;import java.util.*;public class CalendarTest { public static void main(String[] args) { // TODO Auto-generated method stub GregorianCalendar d = new GregorianCalendar(); int today = d.get(Calendar.DAY
一.通过分析日期函数,根据日期进行一系列操作,例如:我们需要知道2个时间段中所有的日期等等. 由于Calendar 类是一个抽象类,因此我们不能通过new来获取该对象的实例.我们可以通过其类方法 getInstance,以获得此类型的一个通用的对象. //获取当前年.月.日 Calendar cal = Calendar.getInstance(); int curr_month=cal.get(Calendar.MONTH)+1; int curr_year=cal.get(Calendar.
今天遇到个小问题觉得挺有意思,与大家分享. 需求是这样的,对数据库中的一张表做按时间的分段统计,结果只要每个区间的数量. select YEAR(create_time) as nian,MONTH(create_time) as yue,count(customid) from custom_info GROUP BY nian,yue 结构是这样的,哈哈 /solr/comment/browse?q=*%3A*&wt=json&indent=true&start=0&