We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.since
.from_now
1 parent aaac037 commit 025e227Copy full SHA for 025e227
README.adoc
@@ -1533,6 +1533,24 @@ Time.zone.now # => Fri, 12 Mar 2014 22:04:47 EET +02:00
1533
Time.current # Same thing but shorter.
1534
----
1535
1536
+== Duration
1537
+
1538
+=== `.since` [[duration-since]]
1539
1540
+Don't use `.since` without a parameter, prefer `.from_now`.
1541
1542
+[source,ruby]
1543
+----
1544
+# bad
1545
+5.hours.since # => It's not clear at first sight that `since` refers to "since now"
1546
1547
+# good
1548
+5.hours.from_now # when refering a future time from now, use from_now
1549
1550
+yesterday = 1.day.ago
1551
+tomorrow = 2.days.since(yesterday) # use since only when you have a referential Time in the past
1552
1553
1554
== Bundler
1555
1556
=== Dev/Test Gems [[dev-test-gems]]
0 commit comments