mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
1、Idcard add age
2、DateUtil wtb add comment
This commit is contained in:
parent
78431520e4
commit
0ecc3393ee
@ -41,8 +41,8 @@ public class DateUtil extends CalendarUtil {
|
||||
*/
|
||||
private final static String[] wtb = { //
|
||||
"sun", "mon", "tue", "wed", "thu", "fri", "sat", // 星期
|
||||
"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", //
|
||||
"gmt", "ut", "utc", "est", "edt", "cst", "cdt", "mst", "mdt", "pst", "pdt"//
|
||||
"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", // 月份
|
||||
"gmt", "ut", "utc", "est", "edt", "cst", "cdt", "mst", "mdt", "pst", "pdt"// 时间标准
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -662,6 +662,7 @@ public class IdcardUtil {
|
||||
private final String cityCode;
|
||||
private final DateTime birthDate;
|
||||
private final Integer gender;
|
||||
private final int age;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
@ -673,6 +674,7 @@ public class IdcardUtil {
|
||||
this.cityCode = IdcardUtil.getCityCodeByIdCard(idcard);
|
||||
this.birthDate = IdcardUtil.getBirthDate(idcard);
|
||||
this.gender = IdcardUtil.getGenderByIdCard(idcard);
|
||||
this.age = IdcardUtil.getAgeByIdCard(idcard);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -720,6 +722,14 @@ public class IdcardUtil {
|
||||
return this.gender;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年龄
|
||||
* @return 年龄
|
||||
*/
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Idcard{" +
|
||||
|
Loading…
x
Reference in New Issue
Block a user