增加生日功能
This commit is contained in:
parent
787de7293b
commit
475d087ed9
@ -12,6 +12,19 @@ import org.joda.time.DateTime;
|
|||||||
*/
|
*/
|
||||||
public class IdCardUtil {
|
public class IdCardUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得生日
|
||||||
|
*
|
||||||
|
* @param idCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getBirth(String idCard) {
|
||||||
|
if (!RegexUtil.isIdentity(idCard)) {
|
||||||
|
throw new ParamsException("身份证格式错误");
|
||||||
|
}
|
||||||
|
return idCard.substring(6, 10) + "-" + idCard.substring(10, 12) + "-" + idCard.substring(12, 14);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取性别
|
* 获取性别
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user