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

猜你喜欢

转载自www.cnblogs.com/ken9527just/p/11419527.html
今日推荐