Class: Pupmin::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/pupmin/util.rb

Overview

Utilities/helpers for various things

Class Method Summary collapse

Class Method Details

.make_timestamp(offset = 0) ⇒ Object

PuppetDB seems to use a timestamp that isn’t quite standard, so this

takes an offset, and creates the time used in reports


6
7
8
9
10
# File 'lib/pupmin/util.rb', line 6

def self.make_timestamp(offset = 0)
  current_time = Time.new.utc
  adjusted_time = current_time - offset
  adjusted_time.strftime('%FT%TZ')
end