Last active
October 20, 2015 12:11
-
-
Save YumaInaura/afb178bb33c3848e6ad8 to your computer and use it in GitHub Desktop.
Rails: Date / Time / DateTime 型の違い。そしてSQL用の文字列を得る方法。 ref: http://qiita.com/Yinaura/items/9c0cbb7c5d9e0440b111
This file contains hidden or 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
Date.today | |
# => Tue, 20 Oct 201 |
This file contains hidden or 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
Time.now | |
# => 2015-10-20 19:22:41 +0900 |
This file contains hidden or 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
DateTime.now | |
# => Tue, 20 Oct 2015 19:22:43 +0900 |
This file contains hidden or 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
Date.today.to_s |
This file contains hidden or 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
Time.now.to_s(:db) |
This file contains hidden or 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
DateTime.now.to_s(:db) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment