Skip to content

Commit 07ebda5

Browse files
author
371718330@qq.com
committed
修改日期格式
1 parent b8ce8e7 commit 07ebda5

File tree

1 file changed

+41
-0
lines changed
  • CommonUtil/src/main/java/com/jingewenku/abrahamcaijin/commonutil

1 file changed

+41
-0
lines changed

CommonUtil/src/main/java/com/jingewenku/abrahamcaijin/commonutil/AppDateMgr.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,4 +1035,45 @@ public static String formatDoubleNumber(double number) {
10351035
DecimalFormat df = new DecimalFormat("#");
10361036
return df.format(number);
10371037
}
1038+
1039+
// /**
1040+
// * 身份证号转生日
1041+
// *
1042+
// * @param identityCard 身份证
1043+
// * @return 生日
1044+
// */
1045+
// public static Date identityCard2Date(String identityCard) {
1046+
// try {
1047+
// String dateStr;
1048+
// if (identityCard.length() == 18) {
1049+
// dateStr = identityCard.substring(6, 14);// 截取18位身份证身份证中生日部分
1050+
// return formatDateString(dateStr, "yyyyMMdd");
1051+
// }
1052+
// if (identityCard.length() == 15) {
1053+
// dateStr = identityCard.substring(6, 12);// 截取15位身份证中生日部分
1054+
// return formatDateString(dateStr, "yyMMdd");
1055+
// }
1056+
// return null;
1057+
// } catch (Exception e) {
1058+
// return null;
1059+
// }
1060+
// }
1061+
//
1062+
// /**
1063+
// * 格式化日期时间字符串
1064+
// *
1065+
// * @param dateString 日期时间字符串
1066+
// * @param pattern 模式
1067+
// * @return Date对象
1068+
// */
1069+
// public static Date formatDateString(String dateString, String pattern) {
1070+
// try {
1071+
// DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(pattern);
1072+
// return dateTimeFormatter.parseDateTime(dateString).toDate();
1073+
// } catch (Exception e) {
1074+
// return null;
1075+
// }
1076+
// }
1077+
1078+
10381079
}

0 commit comments

Comments
 (0)