diff --git a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/component/DiagnosisKeysStructureProvider.java b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/component/DiagnosisKeysStructureProvider.java index 4276c898b1..e1f437692c 100644 --- a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/component/DiagnosisKeysStructureProvider.java +++ b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/component/DiagnosisKeysStructureProvider.java @@ -28,7 +28,6 @@ import app.coronawarn.server.services.distribution.assembly.structure.directory.Directory; import app.coronawarn.server.services.distribution.config.DistributionServiceConfig; import java.time.LocalDateTime; -import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; import java.util.Collection; import org.slf4j.Logger; @@ -68,8 +67,7 @@ public class DiagnosisKeysStructureProvider { public Directory getDiagnosisKeys() { logger.debug("Querying diagnosis keys from the database..."); Collection diagnosisKeys = diagnosisKeyService.getDiagnosisKeys(); - diagnosisKeyBundler.setDiagnosisKeys(diagnosisKeys, - LocalDateTime.now(ZoneOffset.UTC).truncatedTo(ChronoUnit.HOURS)); + diagnosisKeyBundler.setDiagnosisKeys(diagnosisKeys, LocalDateTime.now().truncatedTo(ChronoUnit.HOURS)); return new DiagnosisKeysDirectory(diagnosisKeyBundler, cryptoProvider, distributionServiceConfig); } } diff --git a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/runner/TestDataGeneration.java b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/runner/TestDataGeneration.java index 5775399286..1c1f0a6b58 100644 --- a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/runner/TestDataGeneration.java +++ b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/runner/TestDataGeneration.java @@ -144,7 +144,7 @@ private long getGeneratorStartTimestamp(List diagnosisKeys) { * this function would return the timestamp for today 14:00 UTC. */ private long getGeneratorEndTimestamp() { - return (LocalDateTime.now(ZoneOffset.UTC).toEpochSecond(ZoneOffset.UTC) / ONE_HOUR_INTERVAL_SECONDS) - 1; + return (LocalDateTime.now().toEpochSecond(ZoneOffset.UTC) / ONE_HOUR_INTERVAL_SECONDS) - 1; } /** @@ -153,7 +153,7 @@ private long getGeneratorEndTimestamp() { * 14 days ago (from now) at 00:00 UTC. */ private long getRetentionStartTimestamp() { - return LocalDate.now(ZoneOffset.UTC).minusDays(retentionDays).atStartOfDay() + return LocalDate.now().minusDays(retentionDays).atStartOfDay() .toEpochSecond(ZoneOffset.UTC) / ONE_HOUR_INTERVAL_SECONDS; }