-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date to epoch time conversion issue #18
Comments
Could this have to do with the Date bug that was fixed in |
Possible, I opened a ticket with HipByte. |
Looks like it's the (main)> today = Date.today
=> Thu, 30 Jan 2014
(main)> Time.at(today.to_time.to_i)
=> 2014-01-30 15:26:31 -0500
(main)> tomorrow = Date.today + 1.day
=> Fri, 31 Jan 2014
(main)> Time.at(tomorrow.to_time.to_i)
=> 2014-01-30 19:00:00 -0500
(main)> tomorrow.to_time.to_i
=> 1391126400
Unfortunately, |
Maybe, I think you could solve this issue if you would use |
Good call, @Watson1978. I made this change locally and it seems to mitigate the issue: (main)> today = Date.today
=> Fri, 31 Jan 2014
(main)> Time.at(today.to_time.to_i)
=> 2014-01-31 10:40:49 -0500
(main)> tomorrow = Date.today + 1.day
=> Sat, 01 Feb 2014
(main)> Time.at(tomorrow.to_time.to_i)
=> 2014-02-01 00:00:00 -0500
(main)> tomorrow.to_time.to_i
=> 1391230800
(main)> Date.tomorrow == Time.at(tomorrow.to_time.to_i)
=> true
I ran the tests with this change and got:
Without the change I only have the last error:
So there's obviously some issues with changing that to |
Well, that's hard for me to follow at the moment since I'm on a RubyMotion break. But I can say that I intentionally removed a lot of timezone stuff when porting ActiveSupport to RubyMotion, since an iOS app rarely needs support for more than one time zone at any given time. Also, the last error looks like it's a rounding issue. I'm fairly certain it can be fixed pretty easily. |
The text was updated successfully, but these errors were encountered: