lib/teasy/floating_time.rb in teasy-0.1.3 vs lib/teasy/floating_time.rb in teasy-0.2.0
- old
+ new
@@ -23,9 +23,13 @@
def self.from_time(time)
new(time.year, time.mon, time.day,
time.hour, time.min, time.sec, time.nsec / 1_000.0)
end
+ def in_time_zone(zone)
+ Teasy.with_zone(zone) { TimeWithZone.from_time(self) }
+ end
+
def round!(*args)
@time = time.round(*args)
self
end