Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/casual_support/date/to_ymd.rb
Instance Method Summary collapse
-
#to_ymd ⇒ String
Formats the Date as “YYYY-MM-DD”.
Instance Method Details
#to_ymd ⇒ String
Formats the Date as “YYYY-MM-DD”. Equivalent to strftime(“%Y-%m-%d”).
12 13 14 15 16 17 |
# File 'lib/casual_support/date/to_ymd.rb', line 12 def to_ymd # Date#strftime appears to be **much** faster than Time#strftime # (nearly 3x faster!). Thus it is used here, unlike Time#to_ymd # which uses sprintf. self.strftime('%Y-%m-%d'.freeze) end |