Method: Notifaction::Utils.formatted_time

Defined in:
lib/notifaction/utils.rb

.formatted_time(time = nil) ⇒ Object

Returns a formatted time string Used, mainly, for printing timestamps next to terminal output

Since:

  • 0.0.1



6
7
8
9
10
11
12
# File 'lib/notifaction/utils.rb', line 6

def self.formatted_time(time = nil)
  if time.nil?
    time = Time.now
  end

  time.strftime("%e/%-m/%Y @ %I:%M:%S%P")
end