Last active
December 21, 2018 08:42
-
-
Save YumaInaura/55e3af2c37280ede1525addd0af268fd to your computer and use it in GitHub Desktop.
ActiveSupport::Duration と遊ぶ ref: https://qiita.com/YumaInaura/items/8a18a12722077a710f47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15.minutes | |
=> 15 minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15.minutes.to_i | |
=> 900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60*60 - 15.minutes | |
=> -15 minutes、3600 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(60*60 - 15.minutes).to_i | |
=> 2700 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment