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