mirror of https://github.com/rails/rails
Duck typing here
This commit is contained in:
parent
5dc7f34dca
commit
2651a87a33
|
@ -73,7 +73,7 @@ module ActiveSupport
|
|||
|
||||
# Returns a <tt>Time.local()</tt> instance of the simultaneous time in your system's <tt>ENV['TZ']</tt> zone
|
||||
def localtime
|
||||
utc.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal
|
||||
utc.respond_to?(:getlocal) ? utc.getlocal : utc.to_time.getlocal
|
||||
end
|
||||
alias_method :getlocal, :localtime
|
||||
|
||||
|
|
Loading…
Reference in New Issue