Skip to content

Commit 15c8210

Browse files
committed
Change GMT to Etc/GMT+0
1 parent 262ea66 commit 15c8210

File tree

11 files changed

+19
-18
lines changed

11 files changed

+19
-18
lines changed

common/src/main/java/org/ldbcouncil/snb/impls/workloads/converter/Converter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public class Converter {
1616

1717
public String convertDateTime(Date date) {
1818
final SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_FORMAT);
19-
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
19+
sdf.setTimeZone(TimeZone.getTimeZone("Etc/GMT+0"));
2020
return "'" + sdf.format(date) + "'";
2121
}
2222

2323
public String convertDate(Date date) {
2424
final SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
25-
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
25+
sdf.setTimeZone(TimeZone.getTimeZone("Etc/GMT+0"));
2626
return "'" + sdf.format(date) + "'";
2727
}
2828

duckdb/src/main/java/org/ldbcouncil/snb/impls/workloads/duckdb/DuckDbConnectionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class DuckDbConnectionState<TDbQueryStore extends QueryStore> extends Bas
1717

1818
public DuckDbConnectionState(Map<String, String> properties, TDbQueryStore store) throws ClassNotFoundException, SQLException {
1919
super(properties, store);
20-
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
20+
TimeZone.setDefault(TimeZone.getTimeZone("Etc/GMT+0"));
2121
connection = DriverManager.getConnection("jdbc:duckdb:scratch/ldbc.duckdb");
2222
Statement statement = connection.createStatement();
2323
statement.execute("PRAGMA threads=1;");

duckdb/src/main/java/org/ldbcouncil/snb/impls/workloads/duckdb/converter/DuckDbConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class DuckDbConverter extends Converter {
1515
@Override
1616
public String convertDateTime(Date date) {
1717
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'+00:00'");
18-
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
18+
sdf.setTimeZone(TimeZone.getTimeZone("Etc/GMT+0"));
1919
return "'" + sdf.format(date) + "'::timestamp";
2020
}
2121

postgres/config/postgresql.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ max_parallel_maintenance_workers = 2
2525
listen_addresses = '*'
2626
dynamic_shared_memory_type = posix
2727

28-
log_timezone = 'GMT'
28+
log_timezone = 'Etc/GMT+0'
2929
datestyle = 'iso, mdy'
30-
timezone = 'GMT'
30+
timezone = 'Etc/GMT+0'
3131
lc_messages = 'en_US.utf8' # locale for system error message
3232
lc_monetary = 'en_US.utf8' # locale for monetary formatting
3333
lc_numeric = 'en_US.utf8' # locale for number formatting

postgres/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ services:
2525
- POSTGRES_USER=${POSTGRES_USER}
2626
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
2727
- POSTGRES_DOCKER_PLATFORM_FLAG=${POSTGRES_DOCKER_PLATFORM_FLAG}
28-
- tz=GMT
28+
- tz=Etc/GMT+0
2929
command: [
3030
"postgres",
3131
"-c",
3232
"${POSTGRES_CUSTOM_ARGS}"
3333
]
3434

35-
3635
db-load:
3736
build: ./scripts
3837
image: "postgres-db-loader:latest"
@@ -53,4 +52,5 @@ services:
5352
- WAIT_HOSTS=postgres-db:${POSTGRES_PORT}
5453
- WAIT_TIMEOUT=300
5554
- WAIT_SLEEP_INTERVAL=5
56-
- WAIT_HOST_CONNECT_TIMEOUT=30
55+
- WAIT_HOST_CONNECT_TIMEOUT=30
56+
- tz=Etc/GMT+0

postgres/src/main/java/org/ldbcouncil/snb/impls/workloads/postgres/PostgresDbConnectionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public PostgresDbConnectionState(Map<String, String> properties, TDbQueryStore s
3737
public Connection getConnection() throws DbException {
3838
Connection connection = null;
3939
try {
40-
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
40+
TimeZone.setDefault(TimeZone.getTimeZone("Etc/GMT+0"));
4141
connection = ds.getConnection();
4242
} catch (SQLException e) {
4343
throw new DbException(e);

postgres/src/main/java/org/ldbcouncil/snb/impls/workloads/postgres/converter/PostgresConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class PostgresConverter extends Converter {
2020
@Override
2121
public String convertDateTime(Date date) {
2222
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
23-
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
23+
sdf.setTimeZone(TimeZone.getTimeZone("Etc/GMT+0"));
2424
return "timestamp with time zone '" + sdf.format(date) + "'";
2525
}
2626

@@ -97,7 +97,7 @@ public static Iterable<Long> convertLists(Iterable<List<Object>> arr) {
9797

9898

9999
public static long stringTimestampToEpoch(ResultSet r, int column) throws SQLException {
100-
return r.getTimestamp(column, Calendar.getInstance(TimeZone.getTimeZone("GMT"))).getTime();
100+
return r.getTimestamp(column, Calendar.getInstance(TimeZone.getTimeZone("Etc/GMT+0"))).getTime();
101101
}
102102

103103

tigergraph/src/main/java/org/ldbcouncil/snb/impls/workloads/tigergraph/connector/TigerGraphConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class TigerGraphConverter {
1515
final static String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
1616
final static SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_FORMAT);
1717
static {
18-
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
18+
sdf.setTimeZone(TimeZone.getTimeZone("Etc/GMT+0"));
1919
}
2020

2121
public static Date parseDateTime(String representation) throws ParseException {

umbra/docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
source: ${UMBRA_DATABASE_DIR}
1818
target: /var/db/
1919
environment:
20-
- tz=GMT
20+
- tz=Etc/GMT+0
2121
command: [
2222
"/bin/sh",
2323
"-c",
@@ -45,4 +45,5 @@ services:
4545
- WAIT_HOSTS=umbra-db:5432
4646
- WAIT_TIMEOUT=300
4747
- WAIT_SLEEP_INTERVAL=5
48-
- WAIT_HOST_CONNECT_TIMEOUT=30
48+
- WAIT_HOST_CONNECT_TIMEOUT=30
49+
- tz=Etc/GMT+0

umbra/src/main/java/org/ldbcouncil/snb/impls/workloads/umbra/UmbraDbConnectionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public UmbraDbConnectionState(Map<String, String> properties, TDbQueryStore stor
3838
public Connection getConnection() throws DbException {
3939
Connection connection = null;
4040
try {
41-
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
41+
TimeZone.setDefault(TimeZone.getTimeZone("Etc/GMT+0"));
4242
connection = ds.getConnection();
4343
} catch (SQLException e) {
4444
throw new DbException(e);

0 commit comments

Comments
 (0)