From 29833da8fdea744e1eb4f095d427c1705d2f8449 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Fri, 8 Sep 2023 15:58:57 +0200 Subject: [PATCH] Always include zone --- core/src/main/java/org/jruby/RubyTime.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/jruby/RubyTime.java b/core/src/main/java/org/jruby/RubyTime.java index ab6e5be0b3a..ef90c2521ed 100644 --- a/core/src/main/java/org/jruby/RubyTime.java +++ b/core/src/main/java/org/jruby/RubyTime.java @@ -1323,11 +1323,11 @@ private RubyString mdump(final Ruby runtime) { if (zone != DateTimeZone.UTC) { long offset = zone.getOffset(dt.getMillis()); string.setInternalVariable("offset", runtime.newFixnum(offset / 1000)); + } - String zoneName = zone.getShortName(dt.getMillis()); - if (!TIME_OFFSET_PATTERN.matcher(zoneName).matches()) { - string.setInternalVariable("zone", runtime.newString(zoneName)); - } + String zoneName = zone.getShortName(dt.getMillis()); + if (!TIME_OFFSET_PATTERN.matcher(zoneName).matches()) { + string.setInternalVariable("zone", RubyString.newUSASCIIString(runtime, zoneName)); } return string;