Created
March 1, 2010 22:04
-
-
Save BJClark/318866 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
it "should return contest_ends_at in the proper time zone" do | |
e = Factory(:event) | |
e.contest_ends_at.utc_oftset.should == Time.zone.utc_offset | |
end | |
NoMethodError: undefined method `utc_oftset' for Mon Mar 01 15:59:59 UTC 2010:Time |
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
#in the console | |
>> e.contest_ends_at.utc_offset == Time.zone.utc_offset | |
=> true |
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
>> e.contest_ends_at.zone | |
=> "PST" | |
>> e.contest_ends_at.class | |
=> ActiveSupport::TimeWithZone | |
>> Time.zone.name | |
=> "Pacific Time (US & Canada)" | |
>> Time.zone.now.zone | |
=> "PST" | |
>> Time.zone.abbreviation | |
NoMethodError: undefined method `abbreviation' for #<ActiveSupport::TimeZone:0x101e20c28> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment