Migrate JodaTime to java.time.* in dbBuildingHandler.java

This commit is contained in:
Bardiel committed 2026-10-02 19:24:54 -05:00
1 parent e9ce418772
commit 800f72512d
4 files changed
+20 -19

No files matched your search

+3 -3
View File
@@ -14,7 +14,7 @@ import engine.objects.Bane;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.PlayerCharacter;
import org.joda.time.DateTime;
import java.time.Instant;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
@@ -71,12 +71,12 @@ public class dbBaneHandler extends dbHandlerBase {
}
public boolean SET_BANE_TIME(DateTime toSet, int cityUUID) {
public boolean SET_BANE_TIME(Instant toSet, int cityUUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=? WHERE `cityUUID`=?")) {
preparedStatement.setTimestamp(1, new java.sql.Timestamp(toSet.getMillis()));
preparedStatement.setTimestamp(1, java.sql.Timestamp.from(toSet));
preparedStatement.setLong(2, cityUUID);
preparedStatement.execute();