Module: Eddy::Util::Time

Defined in:
lib/eddy/util/time.rb

Overview

Functions for formatting Time objects.

DT collapse

TM collapse

Class Method Details

.ccyymmdd(date = Time.now.utc) ⇒ String

Generates an timestamp in CCYYMMDD format.



12
13
14
# File 'lib/eddy/util/time.rb', line 12

def self.ccyymmdd(date = Time.now.utc)
  return date.strftime("%Y%m%d")
end

.hhmm(time = Time.now.utc) ⇒ String



30
31
32
# File 'lib/eddy/util/time.rb', line 30

def self.hhmm(time = Time.now.utc)
  return time.strftime("%H%M")
end

.hhmmss(time = Time.now.utc) ⇒ String



36
37
38
# File 'lib/eddy/util/time.rb', line 36

def self.hhmmss(time = Time.now.utc)
  return time.strftime("%H%M%S")
end

.hhmmssd(time = Time.now.utc) ⇒ String



42
43
44
# File 'lib/eddy/util/time.rb', line 42

def self.hhmmssd(time = Time.now.utc)
  return time.strftime("%H%M%S%1N")
end

.hhmmssdd(time = Time.now.utc) ⇒ String



48
49
50
# File 'lib/eddy/util/time.rb', line 48

def self.hhmmssdd(time = Time.now.utc)
  return time.strftime("%H%M%S%2N")
end

.yymmdd(date = Time.now.utc) ⇒ String

Generates an timestamp in YYMMDD format.



20
21
22
# File 'lib/eddy/util/time.rb', line 20

def self.yymmdd(date = Time.now.utc)
  return date.strftime("%y%m%d")
end