Skip to content

Commit e6c5117

Browse files
committed
Use the timezone provided by Truffle instead of ZoneId.systemDefault()
1 parent 4159959 commit e6c5117

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/org/truffleruby/core/time/GetTimeZoneNode.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,14 @@ protected TimeZoneAndName getTimeZone(Object tz) {
8181

8282
if (tz == nil) {
8383
// $TZ is not set, use the system timezone
84-
return new TimeZoneAndName(getSystemTimeZone());
84+
return new TimeZoneAndName(getContext().getEnv().getTimeZone());
8585
} else if (libString.isRubyString(tz)) {
8686
return parse(tzString);
8787
} else {
8888
throw CompilerDirectives.shouldNotReachHere();
8989
}
9090
}
9191

92-
private static ZoneId getSystemTimeZone() {
93-
return ZoneId.systemDefault();
94-
}
95-
9692
private static final Map<String, String> LONG_TZNAME = Helpers.map(
9793
"MET",
9894
"CET", // JRUBY-2759

0 commit comments

Comments
 (0)