Compare commits
2 Commits
9a7bda9527
...
ba21a8f965
| Author | SHA1 | Date | |
|---|---|---|---|
| ba21a8f965 | |||
| 7d2716da7a |
@@ -4011,8 +4011,10 @@ func calculateAgeAndSex(idCard string) (int, string) {
|
||||
return 0, ""
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
// 计算年龄(简化处理,使用当前年份)
|
||||
age := 2024 - year
|
||||
age := now.Year() - year
|
||||
|
||||
// 提取性别(第17位,奇数为男,偶数为女)
|
||||
sexCode := idCard[16:17]
|
||||
|
||||
Reference in New Issue
Block a user