Class: Motoko::Formatters::Timestamp

Inherits:
BaseFormatter show all
Defined in:
lib/motoko/formatters/timestamp.rb

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

This class inherits a constructor from Motoko::Formatters::BaseFormatter

Instance Method Details

#format(value) ⇒ Object



8
9
10
11
12
# File 'lib/motoko/formatters/timestamp.rb', line 8

def format(value)
  Time.at(Integer(value)).getlocal.to_s
rescue ArgumentError, TypeError
  nil
end