public static RubyTime /*!*/ AddSeconds(RubyTime /*!*/ self, [DefaultProtocol] double seconds) { try { return(new RubyTime(RubyTime.AddSeconds(self.DateTime, seconds))); } catch (OverflowException) { throw RubyExceptions.CreateRangeError("time + {0:F6} out of Time range", seconds); } }
public static RubyTime /*!*/ SubtractSeconds(RubyTime /*!*/ self, [DefaultProtocol] double seconds) { DateTime result; try { result = RubyTime.AddSeconds(self.DateTime, -seconds); } catch (OverflowException) { throw RubyExceptions.CreateRangeError("time - {0:F6} out of Time range", seconds); } return(new RubyTime(result)); }
public static RubyTime /*!*/ Create(RubyClass /*!*/ self, double seconds) { return(new RubyTime(RubyTime.ToLocalTime(RubyTime.AddSeconds(RubyTime.Epoch, seconds)))); }