Class: Blufin::DateTimeUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/core/datetime_utils.rb

Class Method Summary collapse

Class Method Details

.now(format = nil) ⇒ Object

Returns the current DateTime as string. Default format is: %d/%m/%Y %H:%M:%S

Returns:

  • String



7
8
9
10
# File 'lib/core/datetime_utils.rb', line 7

def self.now(format = nil)
    format = '%Y/%m/%d %H:%M:%S' if format.nil?
    Time.now.strftime(format)
end