Module: Pkg::Util::Date

Defined in:
lib/packaging/util/date.rb

Overview

Utilities for managing/querying date/time

Class Method Summary collapse

Class Method Details

.timestamp(separator = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/packaging/util/date.rb', line 5

def timestamp(separator = nil)
  if s = separator
    format = "%Y#{s}%m#{s}%d#{s}%H#{s}%M#{s}%S"
  else
    format = "%Y-%m-%d %H:%M:%S"
  end
  Time.now.strftime(format)
end

.todayObject



14
15
16
17
# File 'lib/packaging/util/date.rb', line 14

def today
  format = "%m/%d/%Y"
  Time.now.strftime(format)
end