Sha256: 0f13d98f0858f86ee168fa11e2b51804bd1f895c73e6344e9773e02ed9c460d1
Contents?: true
Size: 508 Bytes
Versions: 18
Compression:
Stored size: 508 Bytes
Contents
# Default DATE_FORMATS available # # Time::DATE_FORMATS.merge!({ # :db => "%Y-%m-%d %H:%M:%S", # :number => "%Y%m%d%H%M%S", # :time => "%H:%M", # :mdy => "%B %d, %Y", # :short => "%d %b %H:%M", # :long => "%B %d, %Y %H:%M" # }) # === Example Useage # DateTime.now().to_format(:mdy) # class DateTime # Helper method for string formatting DateTime. def to_format(key = :default) if format = ::Time::DATE_FORMATS[key] strftime(format) else to_s end end end
Version data entries
18 entries across 18 versions & 2 rubygems