Created
August 3, 2013 16:08
-
-
Save toshiwo/6146982 to your computer and use it in GitHub Desktop.
RubyMotionで Time.at を使おうとした際の挙動について。
Ruby2.0での挙動も乗せておきました。(1.9.3-p448でも同様でした)
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
irb(main):001:0> '9241205101'.to_i | |
=> 9241205101 | |
irb(main):002:0> '9241205101'.to_i.class | |
=> Fixnum | |
irb(main):003:0> Time.at('9241205101'.to_i) | |
=> 2262-11-04 18:25:01 +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
(main)> '9241205101'.to_i | |
=> 9241205101 | |
(main)> '9241205101'.to_i.class | |
=> Bignum | |
(main)> Time.at('9241205101'.to_i) | |
2013-08-04 01:01:00.713 hello[32862:c07] bignum too big to convert into `long' (RangeError) | |
=> #<RangeError: bignum too big to convert into `long'> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment