身份证信息如何提取出生年月?
2018-02-27 15:24
218 查看
1.身份证提起出生年月信息
注意:有15位和18位
注意:有15位和18位
public String idCard2Birthday(String no) { String birthday = ""; if (no.length() == 15) { String tempYear = no.substring(6, 8); String tempMonth = no.substring(8, 10); String tempDate = no.substring(10, 12); int tempCYear = Calendar.getInstance().get(Calendar.YEAR); tempYear = "20" + tempYear; int itempYear = Integer.parseInt(tempYear); if (itempYear > tempCYear) { tempYear = "19" + tempYear.substring(2); } birthday = tempYear + "-" + tempMonth + "-" + tempDate; } else if (no.length() == 18) { String tempYear = no.substring(6, 10); String tempMonth = no.substring(10, 12); String tempDate = no.substring(12, 14); birthday = tempYear + "-" + tempMonth + "-" + tempDate; } return birthday; }
相关文章推荐
- 如何用oracle从身份证信息中提取出生日期?
- EXCEL中如何提取身份证出生日期和性别信息以及检验身份证号码的正确性
- 如何在EXCEL中提取身份证号码里的出生年月日、性别等,相关信息
- 如何在Excel中提取身份证号码中的信息
- java身份证合法性校验并提取身份证有效信息
- 永中Office教你如何从身份证号码中提取出生时间及性别
- php如何防止页面中的敏感信息被提取
- freecms如何在信息列表类标签中提取info.content
- 校验二代身份证,提取生日性别等信息
- java验证身份证号码及编码规则和提取相应信息
- <Power Shell>21 如何从远程客户端快速提取信息 推荐
- 看我如何用**.qq.com两位短域名钓鱼收集用户敏感信息(如QQ\密码\密保手机号\身份证)
- web数据采集核心技术分享系列(二)如何提取信息?字符串?正则?xpath?xslt?自定义?...什么才是王道?
- 如何防止页面中的敏感信息被提取
- Jq根据身份证号提取信息
- 扫描身份证提取信息ocr技术
- [DNN学习所得]如何防止页面中的敏感信息被提取
- FFMPEG Tips (2) 如何提取码流的基本信息
- SD--如何编程提取SD的定价信息
- 如何让用ARCMAP提取地图坐标信息