class ActiveSupport::TimeWithZone
def to_fs(format = :default)
Experimental RBS support (using type sampling data from the type_fusion
project).
def to_fs: (?Symbol format) -> String
This signature was generated using 1 sample from 1 application.
* :db - format outputs time in UTC :db time. See Time#to_fs(:db).
* :default - default value, mimics Ruby Time#to_s format.
Accepts an optional format:
This method is aliased to to_formatted_s.
Returns a string of the object's date and time.
def to_fs(format = :default) if format == :db utc.to_fs(format) elsif formatter = ::Time::DATE_FORMATS[format] formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter) else # Change to to_s when deprecation is gone. "#{time.strftime("%Y-%m-%d %H:%M:%S")} #{formatted_offset(false, 'UTC')}" end end