Created
May 14, 2013 09:49
-
-
Save swdyh/5574853 to your computer and use it in GitHub Desktop.
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
require 'time' | |
# http://doc.ruby-lang.org/ja/2.0.0/method/Time/i/iso8601.html | |
t = Time.now | |
p t # 2013-05-14 18:42:37 +0900 | |
p t.iso8601 # "2013-05-14T18:42:37+09:00" | |
p t.iso8601(3) # "2013-05-14T18:42:37.192+09:00" | |
p t.iso8601(6) # "2013-05-14T18:42:37.192681+09:00" | |
p t.iso8601(10) # "2013-05-14T18:42:37.1926810000+09:00" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment