Class: Time

Inherits:
Object show all
Defined in:
lib/sixarm_ruby_ramp/time.rb

Overview

Time extensions

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.packString

Shorthand for Time.now.pack

Examples:

Time.pack
=> "20101231125959" 

Returns:



28
29
30
# File 'lib/sixarm_ruby_ramp/time.rb', line 28

def self.pack
  now.pack
end

Instance Method Details

#packString

The time is converted to UTC.

Examples:

Time.now.pack
=> "20101231125959" 

Returns:

  • (String)

    time packed into a short string: “YYYYMMDDHHMMSS”



15
16
17
# File 'lib/sixarm_ruby_ramp/time.rb', line 15

def pack
  getutc.strftime('%Y%m%d%H%M%S')
end