Commit 53e94d8c authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Set default locale US and default time zone UTC.

Part of #33655.
parent 5a7c1970
......@@ -3,6 +3,8 @@
* Minor changes
- Improve logging of the database importer.
- Simplify logging configuration.
- Set default locale `US` and default time zone `UTC` at the
beginning of the execution.
# Changes in version 4.3.0 - 2020-01-15
......
......@@ -39,9 +39,11 @@ import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.TimeZone;
import java.util.TreeMap;
/* Import Tor descriptors into the ExoneraTor database. */
......@@ -52,6 +54,8 @@ public class ExoneraTorDatabaseImporter {
/** Main function controlling the parsing process. */
public static void main(String[] args) {
Locale.setDefault(Locale.US);
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
logger.info("Starting ExoneraTor database importer.");
readConfiguration();
openDatabaseConnection();
......
......@@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.regex.Pattern;
......@@ -224,7 +223,6 @@ public class QueryServlet extends HttpServlet {
String passedTimestampParameter) {
LocalDate timestamp = null;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
dateFormat.setLenient(false);
if (passedTimestampParameter != null
&& passedTimestampParameter.length() > 0) {
......
......@@ -9,6 +9,9 @@ import org.eclipse.jetty.xml.XmlConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import java.util.TimeZone;
public class ServerMain {
private static final Logger logger
......@@ -16,6 +19,8 @@ public class ServerMain {
/** Starts the web server listening for incoming client connections. */
public static void main(String[] args) {
Locale.setDefault(Locale.US);
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
try {
Resource jettyXml = Resource.newSystemResource("jetty.xml");
logger.info("Reading configuration from '{}'.", jettyXml);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment