| | 22 | # Convert to a formatted string - see DATE_FORMATS for predefined formats. |
|---|
| | 23 | # You can also add your own formats to the DATE_FORMATS constant and use them with this method. |
|---|
| | 24 | # |
|---|
| | 25 | # examples: |
|---|
| | 26 | # |
|---|
| | 27 | # time = Time.now # => Thu Jan 18 06:10:17 CST 2007 |
|---|
| | 28 | # time.to_formatted_s(:time) # => "Thu Jan 18 06:10:17 CST 2007" |
|---|
| | 29 | # time.to_formatted_s(:db) # => "2007-01-18 06:10:17" |
|---|
| | 30 | # time.to_formatted_s(:short) # => "18 Jan 06:10"</tt> |
|---|
| | 31 | # time.to_formatted_s(:long) # => "January 18, 2007 06:10" |
|---|
| | 32 | # time.to_formatted_s(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" |
|---|