Module: Jylis::Helpers::Timestamp

Defined in:
lib/jylis-rb/helpers/timestamp.rb

Instance Method Summary collapse

Instance Method Details

#timeTime

Returns the timestamp as a Time object

Returns:

  • (Time)

    the timestamp as a Time object



5
6
7
# File 'lib/jylis-rb/helpers/timestamp.rb', line 5

def time
  Time.at(timestamp)
end

#timestamp_iso8601String

Returns the timestamp as an ISO8601 formatted string

Returns:

  • (String)

    the timestamp as an ISO8601 formatted string



10
11
12
# File 'lib/jylis-rb/helpers/timestamp.rb', line 10

def timestamp_iso8601
  time.utc.iso8601
end