instance method
utc_to_local
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
utc_to_local(utc)
Converts a time in UTC to the local timezone. utc can either be a DateTime, Time or timestamp (Time.to_i). The returned time has the same type as utc. Any timezone information in utc is ignored (it is treated as a UTC time).
Parameters
-
utcreq
Source
# File activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb, line 373
def utc_to_local(utc)
TimeOrDateTime.wrap(utc) {|wrapped|
period_for_utc(wrapped).to_local(wrapped)
}
end
Defined in activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb line 373
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TZInfo::Timezone