refactor: migrate JodaTime to java.time (rebuild on subdate2 ab96cfc)
Complete the JodaTime -> java.time migration across 30 files on the correct subdate2 base. No org.joda references remain.
This commit is contained in:
1 parent
ab96cfcda4
commit
8a136d84f4
30 files changed
+184
-196
No files matched your search
@@ -15,7 +15,8 @@ import engine.mbEnums;
|
||||
import engine.mbEnums.ProfitType;
|
||||
import engine.objects.NPC;
|
||||
import engine.objects.NPCProfits;
|
||||
import org.joda.time.DateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -240,7 +241,7 @@ public class dbNPCHandler extends dbHandlerBase {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean updateUpgradeTime(NPC npc, DateTime upgradeDateTime) {
|
||||
public boolean updateUpgradeTime(NPC npc, LocalDateTime upgradeDateTime) {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_npc SET upgradeDate=? "
|
||||
@@ -249,7 +250,7 @@ public class dbNPCHandler extends dbHandlerBase {
|
||||
if (upgradeDateTime == null)
|
||||
preparedStatement.setNull(1, java.sql.Types.DATE);
|
||||
else
|
||||
preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.getMillis()));
|
||||
preparedStatement.setTimestamp(1, new java.sql.Timestamp(upgradeDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
|
||||
|
||||
preparedStatement.setInt(2, npc.getObjectUUID());
|
||||
|
||||
|
||||
Reference in new issue
Block a user