Java提供了另一功能更加强大的Calendar,我们使用Calendar就可以了。比如Date nowDate = new Date();可以用Calendar now = Calendar.getInstance();这样子可以拿到一个当前时间的Calendar对象(当然可以再用 now.setTime(nowDate)来用某个Date指定这个Calendar时间),调用now.getTime()就可以拿到Date对象,调 用now.getTimeInMills()可以拿到long类型的毫秒数,调用now.get(Calendar.YEAR)、 now.get(Calendar.DAY_O Read More
posted @ 2012-08-21 15:57 tangrongyue Views(325) Comments(0) Diggs(0) Edit