module EasyFormat::DateTime

Public Instance Methods

hhmmss(time = Time.now) click to toggle source
# File lib/easy_format/date_time.rb, line 15
def hhmmss(time = Time.now)
  log_deprecation('EasyFormat::DateTime', __method__)
  time = ::Time.parse(time) unless time.is_a?(Time)
  time.strftime('%H%M%S')
end
log_deprecation(namespace, method_name) click to toggle source
# File lib/easy_format/date_time.rb, line 5
def log_deprecation(namespace, method_name)
  EasyIO.logger.warn "#{namespace}.#{method_name} is deprecated! Use EasyTime.#{method_name} instead (require 'easy_time')!"
end
yyyymmdd(date = Time.now) click to toggle source
# File lib/easy_format/date_time.rb, line 9
def yyyymmdd(date = Time.now)
  log_deprecation('EasyFormat::DateTime', __method__)
  date = ::Time.parse(date) unless date.is_a?(Time)
  date.strftime('%Y%m%d')
end
yyyymmdd_hhmmss(date_and_time = Time.now) click to toggle source
# File lib/easy_format/date_time.rb, line 21
def yyyymmdd_hhmmss(date_and_time = Time.now)
  log_deprecation('EasyFormat::DateTime', __method__)
  date_and_time = ::Time.parse(date_and_time) unless date_and_time.is_a?(Time)
  date_and_time.strftime('%Y%m%d_%H%M%S')
end