1、Date对象:Date date = getDate();

2、Calendar实例:Calendar calendar = Calendar.getInstance();

3、calendar.setTime(date);

4、int year = calendar.get(Calendar.YEAR);

      int month = calendar.get(Calendar.MONTH);

      int day = calendar.get(Calendar.DAY_OF_MONTH);

参考网址:https://blog.csdn.net/u010273007/article/details/67638406

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-02-16
  • 2022-12-23
  • 2021-06-26
猜你喜欢
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案