Exemplo n.º 1
0
 @Specialization
 public RubyTime timeSDup(RubyTime other) {
   final RubyTime time =
       new RubyTime(
           getContext().getCoreLibrary().getTimeClass(), other.getDateTime(), other.getOffset());
   return time;
 }
Exemplo n.º 2
0
 @Specialization
 public Object timeUTCOffset(RubyTime time) {
   Object offset = time.getOffset();
   if (offset != nil()) {
     return offset;
   } else {
     return time.getDateTime().getZone().getOffset(time.getDateTime().getMillis()) / 1_000;
   }
 }