Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions truffle/src/main/java/org/jruby/truffle/core/time/TimeNodes.java
Original file line number Diff line number Diff line change
@@ -185,11 +185,16 @@ public DynamicObject localtime(DynamicObject time) {
Layouts.TIME.setIsUtc(time, true);
Layouts.TIME.setRelativeOffset(time, false);
Layouts.TIME.setZone(time, nil());
Layouts.TIME.setDateTime(time, dateTime.withZone(DateTimeZone.UTC));
Layouts.TIME.setDateTime(time, inUTC(dateTime));

return time;
}

@TruffleBoundary
private DateTime inUTC(final DateTime dateTime) {
return dateTime.withZone(DateTimeZone.UTC);
}

}

@CoreMethod(names = "allocate", constructor = true)
@@ -204,8 +209,7 @@ public AllocateNode(RubyContext context, SourceSection sourceSection) {

@Specialization
public DynamicObject allocate(DynamicObject rubyClass) {
return allocateObjectNode.allocate(rubyClass, ZERO, 0, coreLibrary().getNilObject(),
0, false, false);
return allocateObjectNode.allocate(rubyClass, ZERO, 0, coreLibrary().getNilObject(), 0, false, false);
}

}
@@ -284,7 +288,6 @@ private DateTime utcTime(long milliseconds) {

@TruffleBoundary
private DateTime offsetTime(long milliseconds, long offset) {

return new DateTime(milliseconds, DateTimeZone.forOffsetMillis((int) offset * 1000));
}

0 comments on commit 5d22b02

Please sign in to comment.