File tree 1 file changed +9
-1
lines changed
backend/framework/src/main/java/org/jumpserver/chen/framework/console/dataview
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 18
18
import java .io .IOException ;
19
19
import java .nio .file .Files ;
20
20
import java .sql .SQLException ;
21
+ import java .text .SimpleDateFormat ;
21
22
import java .time .LocalDateTime ;
22
23
import java .time .format .DateTimeFormatter ;
24
+ import java .util .Date ;
23
25
import java .util .HashMap ;
24
26
import java .util .List ;
25
27
import java .util .Map ;
@@ -165,7 +167,13 @@ public void export(String scope) throws SQLException {
165
167
writer .write ("NULL" );
166
168
writer .write ("," );
167
169
} else {
168
- writeString (writer , row .get (field .getName ()));
170
+ var obj = row .get (field .getName ());
171
+ if (obj instanceof Date ) {
172
+ SimpleDateFormat fmt = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" );
173
+ writeString (writer , fmt .format (obj ));
174
+ } else {
175
+ writeString (writer , obj );
176
+ }
169
177
writer .write ("," );
170
178
}
171
179
}
You can’t perform that action at this time.
0 commit comments