lib/timespan.rb in timespan-0.2.8 vs lib/timespan.rb in timespan-0.3.1

- old
+ new

@@ -118,11 +118,15 @@ calculate_miss! validate! end def default_from_now! - self.start_time = Time.now unless start_time || (end_time && duration) - self.end_time = Time.now unless end_time || (start_time && duration) + self.start_time = now unless start_time || (end_time && duration) + self.end_time = now unless end_time || (start_time && duration) + end + + def now + Time.now.utc end def validate! raise ArgumentError, "#{valid_requirement}, was: #{init_options.inspect} resulting in state: #{current_config}" unless valid? end \ No newline at end of file