Fix TimeZone

This commit is contained in:
2024-04-27 01:34:24 -04:00
parent 06854da00e
commit bc03a8a79d

View File

@ -12,10 +12,7 @@ import java.nio.file.Path;
import java.nio.file.StandardCopyOption; import java.nio.file.StandardCopyOption;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/** /**
* @author Braydon * @author Braydon
@ -34,6 +31,8 @@ public final class ReadMeManager {
System.out.println("Updating README.md..."); System.out.println("Updating README.md...");
try (InputStream templateResource = ReadMeManager.class.getClassLoader().getResourceAsStream("README_TEMPLATE.md")) { try (InputStream templateResource = ReadMeManager.class.getClassLoader().getResourceAsStream("README_TEMPLATE.md")) {
assert templateResource != null; // Ensure the template is present assert templateResource != null; // Ensure the template is present
Calendar calendarTime = Calendar.getInstance(TimeZone.getTimeZone("America/Toronto"));
calendarTime.setTime(new Date());
// Copy the template README.md to the root directory // Copy the template README.md to the root directory
Path localReadMe = new File("README.md").toPath(); // The local README.md file Path localReadMe = new File("README.md").toPath(); // The local README.md file
@ -42,7 +41,7 @@ public final class ReadMeManager {
// Replace variables in the README.md file // Replace variables in the README.md file
String contents = new String(Files.readAllBytes(localReadMe)); String contents = new String(Files.readAllBytes(localReadMe));
contents = contents.replace("<total-servers>", DECIMAL_FORMAT.format(servers.size())); // Total servers variable contents = contents.replace("<total-servers>", DECIMAL_FORMAT.format(servers.size())); // Total servers variable
contents = contents.replace("<last-updated>", DATE_FORMAT.format(new Date()).replace(" ", "_")); // Total servers variable contents = contents.replace("<last-updated>", DATE_FORMAT.format(calendarTime.getTime()).replace(" ", "_")); // Total servers variable
// Write the total servers per-region table // Write the total servers per-region table
Map<String, Integer> regionCounts = new HashMap<>(); Map<String, Integer> regionCounts = new HashMap<>();