提交 7063e254 编写于 作者: S schneems

[ci skip] doc ActiveSupport::TimeWithZone#to_s

Current docs are wrong. Does not accept strftime inputs.
上级 aabbf07d
...@@ -185,8 +185,11 @@ def rfc2822 ...@@ -185,8 +185,11 @@ def rfc2822
end end
alias_method :rfc822, :rfc2822 alias_method :rfc822, :rfc2822
# <tt>:db</tt> format outputs time in UTC; all others output time in local. # Returns a string of the object's date and time.
# Uses TimeWithZone's +strftime+, so <tt>%Z</tt> and <tt>%z</tt> work correctly. # Accepts an optional <tt>format</tt>:
# * <tt>:default</tt> - default value, mimics Ruby 1.9 Time#to_s format.
# * <tt>:db</tt> - format outputs time in UTC :db time. See Time#to_formatted_s(:db).
# * Any key in <tt>Time::DATE_FORMATS</tt> can be used. See active_support/core_ext/time/conversions.rb.
def to_s(format = :default) def to_s(format = :default)
if format == :db if format == :db
utc.to_s(format) utc.to_s(format)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册