Skip to content

Commit

Permalink
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/_load_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/getlocal_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Time#getlocal returns a new time which is the local representation of time
fails:Time#getlocal returns a new time with the correct utc_offset according to the set timezone
fails:Time#getlocal returns a Time with a UTC offset of the specified number of Rational seconds
fails:Time#getlocal with an argument that responds to #to_r coerces using #to_r
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/time/localtime_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Time#localtime converts self to local time, modifying the receiver
fails:Time#localtime returns self
fails:Time#localtime returns a Time with a UTC offset of the specified number of Rational seconds
fails:Time#localtime changes the timezone according to the set one
fails:Time#localtime with an argument that responds to #to_r coerces using #to_r
Original file line number Diff line number Diff line change
@@ -320,7 +320,11 @@ public TimeEnvZonePrimitiveNode(RubyContext context, SourceSection sourceSection

@Specialization
public Object timeEnvZone(DynamicObject time) {
throw new UnsupportedOperationException("time_env_zone");
final DateTime dt = Layouts.TIME.getDateTime(time);

final String timezone = dt.getZone().getShortName(dt.getMillis());

return Layouts.STRING.createString(getContext().getCoreLibrary().getStringFactory(), RubyString.encodeBytelist(timezone, UTF8Encoding.INSTANCE), StringSupport.CR_UNKNOWN, null);
}

}

0 comments on commit fdec4d5

Please sign in to comment.