Android读取date中年月日

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

posted on 2019-08-27 17:12  ken9527just  阅读(4200)  评论(0编辑  收藏  举报

导航