Skip to content
Browse files

Add #getutc alias for DateTime#utc

  • Loading branch information...
1 parent 0289b0e commit f285b6119b9ca7f598e31c0c8518dce3e1b13386 @gbuesing gbuesing committed Apr 12, 2008
View
2 activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Add #getutc alias for DateTime#utc [Geoff Buesing]
+
* Refactor TimeWithZone: don't send #since, #ago, #+, #-, #advance through method_missing [Geoff Buesing]
* TimeWithZone respects config.active_support.use_standard_json_time_format [Geoff Buesing]
View
1 activesupport/lib/active_support/core_ext/date_time/calculations.rb
@@ -86,6 +86,7 @@ def end_of_day
def utc
new_offset(0)
end
+ alias_method :getutc, :utc
# Returns true if offset == 0
def utc?
View
1 activesupport/test/core_ext/date_time_ext_test.rb
@@ -240,6 +240,7 @@ def test_utc
assert_equal DateTime.civil(2005, 2, 21, 15, 11, 12, 0), DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-5, 24)).utc
assert_equal DateTime.civil(2005, 2, 21, 10, 11, 12, 0), DateTime.civil(2005, 2, 21, 10, 11, 12, 0).utc
assert_equal DateTime.civil(2005, 2, 21, 9, 11, 12, 0), DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(1, 24)).utc
+ assert_equal DateTime.civil(2005, 2, 21, 9, 11, 12, 0), DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(1, 24)).getutc
end
def test_formatted_offset_with_utc

0 comments on commit f285b61

Please sign in to comment.
Something went wrong with that request. Please try again.