Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/string_formatted_date.rb
Instance Method Summary collapse
Instance Method Details
#formatted(format_string) ⇒ Object
2 3 4 5 6 |
# File 'lib/string_formatted_date.rb', line 2 def formatted(format_string) strftime_hash = {"YYYY" => "%Y", "YY" => "%y", "MM" => "%m", "DD" => "%d", "D" => "%-d", "MONTH" => "%^B", "Month" => "%B", "MON." => "%^b", "Mon." => "%b" } strftime_hash.each{|k,v| format_string.gsub!(k,v)} self.strftime(format_string) end |