Class: PVN::Log::DateFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/pvn/log/formatter/date_formatter.rb

Overview

a format for the date.

Constant Summary collapse

DEFAULT_FORMAT =
"%y-%m-%d %H:%M:%S"

Instance Method Summary collapse

Instance Method Details

#format(date) ⇒ Object



11
12
13
14
# File 'lib/pvn/log/formatter/date_formatter.rb', line 11

def format date
  dt = date.kind_of?(DateTime) ? date : DateTime.parse(date.to_s)
  dt.strftime DEFAULT_FORMAT
end