Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
处理日期时间格式问题
Browse files Browse the repository at this point in the history
2511689622 committed Jan 16, 2025
1 parent e2669df commit 8ac3d9d
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 11 additions & 2 deletions openeuler/src/main/java/Parse.java
Original file line number Diff line number Diff line change
@@ -1123,11 +1123,20 @@ public static List<Map<String, Object>> parseReleaseDataOnGitee(File paresFile)
if ("date".equals(map.get(keyString))) {
valueString = valueString.replaceAll("/", "-");
String[] parts = valueString.split("-");
String newString = "";
for (int i = 0; i < parts.length; i++) {
if (parts[i].length() == 1) {
parts[i] = "0" + parts[i];
}
newString += (i == 0 ? "" : "-") + parts[i];
}
if (parts.length - 1 == 1) {
valueString += "-01";
newString += "-01";
}
resMap.put(map.get(keyString), newString);
} else {
resMap.put(map.get(keyString), valueString);
}
resMap.put(map.get(keyString), valueString);
}
}
if (resMap.size() > 0) {
1 change: 0 additions & 1 deletion openeuler/src/main/java/etherpad/GETRequest.java
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
package etherpad;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

0 comments on commit 8ac3d9d

Please sign in to comment.