Java is localizing the AM/PM marker from a result set
09:09 27 Jan 2021

I have the following simple code to return the current datetime from an Oracle database:

String sql = "select to_char(sysdate,'MM/dd/yyyy HH:MI AM') from dual";

Statement statement = dbConnection.createStatement();
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
    value = rs.getString(1);
    System.out.println(value);
}

If I run the same SQL Statement in other applications (like DBeaver), I get:

01/27/2021 03:04 PM

But when I run the Java code (either from Eclipse or command line), I'm getting:

01/27/2021 03:04 TARDE

It looks like Java is localizing the AM/PM marker, but I couldn't find where this can be configured. This only happens in my machine. Is it possible to configure this somewhere without changing the code? Because this same Java code is running and printing the expected result in other machines (with the PM / AM marker, instead of the word TARDE).

I'm using Windows 10 and JDK 8u281

java oracle-database eclipse windows-10