Skip to content
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/Time class not working as expected #17

Open
kapso opened this issue Jan 6, 2014 · 1 comment
Open

Date/Time class not working as expected #17

kapso opened this issue Jan 6, 2014 · 1 comment

Comments

@kapso
Copy link

kapso commented Jan 6, 2014

See issue below where today is greater than tomorrow

(main)> today = Date.today
=> Sat, 04 Jan 2014

(main)> tomorrow = Date.today + 1.day
=> Sun, 05 Jan 2014

(main)> today > tomorrow
=> true

(main)> today.to_time.to_i > tomorrow.to_time.to_i
=> true

I am using the following version - motion-support (0.2.6)

Gemfile:

gem "motion-support", require: false

Rakefile:

require "motion-support/core_ext/time"
@Watson1978
Copy link

When I adjust my MacBook time from local time zone to GMT-08:00 zone and 11pm.
Then I can reproduce your problem.

(main)> today = Date.today
=> Thu, 30 Jan 2014
(main)> tomorrow = Date.today + 1.day
=> Fri, 31 Jan 2014
(main)> today.to_time
=> 2014-01-30 23:04:51 -0800
(main)> tomorrow.to_time
=> 2014-01-31 00:00:00 UTC
(main)> today.to_time.to_i
=> 1391151891
(main)> tomorrow.to_time.to_i
=> 1391126400
(main)>

I think this and #18 are same problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants