Skip to content

Commit 2496d42

Browse files
committed
Fixed bug storing date to database
1 parent 9d6141e commit 2496d42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/ffxivcensus/gatherer/GathererController.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ public GathererController(int startId, int endId, boolean quiet, boolean verbose
236236
this.tableName = "tblplayers";
237237
this.tableSuffix = tableSuffix;
238238
this.splitTables = splitTables;
239+
this.storeActiveDate = true;
240+
this.storePlayerActive = true;
239241
}
240242

241243
/**
@@ -530,7 +532,12 @@ protected String writeToDB(Player player) {
530532
sbFields.append(",");
531533
sbValues.append(",");
532534
sbFields.append("date_active");
533-
sbValues.append(player.getDateImgLastModified());
535+
java.util.Date dt = new java.util.Date();
536+
537+
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
538+
539+
String sqlDate = sdf.format(player.getDateImgLastModified());
540+
sbValues.append("\"" + sqlDate + "\"");
534541
}
535542
if(this.storePlayerActive) {
536543
sbFields.append(",");

0 commit comments

Comments
 (0)