Method: EZTime#eztime

Defined in:
lib/eztime.rb

#eztime(format_str) ⇒ Object

Formats the date/time according to the formatting string format_str The formatting string consists of any of the methods defined in EZTime (such as meridian, ordinal, zhour, etc.) as well as any other methods available to the object class. The methods are named in the string by preceeded them with a single colon (:). Any characters not preceeded by a colon will be passed through directly.

Example

d = DateTime.civil(2003, 12, 20, 17, 30, 0) 
puts d.eztime(":day :nmonth :year at :hour12::minute::second :lmeridian")

Output: 20 December 2003 at 5:30:00 pm


129
130
131
# File 'lib/eztime.rb', line 129

def eztime(format_str)
  EZTime::FormattedTime.new(self).format(format_str)
end