1.Date类的核心是 long 类型的数值,Date类中getTime方法的源码如下:
/**
 * Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT
 * represented by this <tt>Date</tt> object.
 *
 * @return  the number of milliseconds since January 1, 1970, 00:00:00 GMT
 *          represented by this date.
 */
public long getTime() {
    return getTimeImpl();
}
 
2.Calendar是一个抽象类,声明了日历的相关操作,如
set(field,value),add(field.value),getActualMaximum(field)等方法。
 
3.DateFormat也是抽象类,声明了日期和字符串相互转换的操作。
 

Date、Calendar、DateFormat
 

相关文章:

  • 2021-05-14
  • 2021-07-19
  • 2022-12-23
  • 2022-02-08
  • 2021-10-16
  • 2021-10-14
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-02-08
  • 2021-06-21
相关资源
相似解决方案