Skip to content

Commit

Permalink
Merge pull request #74 from jumpserver/pr@v3@feat_format_timestamp_field
Browse files Browse the repository at this point in the history
feat: format datetime field
  • Loading branch information
Aaron3S authored Jan 2, 2025
2 parents 7981372 + 1eb47eb commit 7624871
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ public void export(String scope) throws SQLException {
writer.newLine();

for (List<Object> row : result.getData()) {
for (Object o : row) {
if (o == null) {
writer.write("NULL");
writer.write(",");
for (Object obj : row) {
if (obj instanceof Date) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
writeString(writer, fmt.format(obj));
} else {
writer.write(o.toString());
writer.write(",");
writeString(writer, obj);
}
writer.write(",");
}
writer.newLine();
}
Expand Down

0 comments on commit 7624871

Please sign in to comment.