Sha256: 1c91ab6d1d19aad183b44aba32f0976b6fef3d9945f502489c2758bc9fc37bf8

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

# -*- coding: utf-8 -*-
=begin rdoc
Time class extensions.
=end

class Time

  # The time, in UTC, using a terse format "YYYYMMDDHHMMSS".
  #
  # Example:
  #
  #     Time.now.terse 
  #     => "20151231125959"
  #
  # Return:
  #
  #  * [String] time formatted as "YYYYMMDDHHMMSS"
  #
  def terse
    getutc.strftime('%Y%m%d%H%M%S')
  end

  # The time now, in UTC, using a terse format "YYYYMMDDHHMMSS".
  #
  # Example:
  #
  #     Time.terse
  #     => "20151231125959" 
  #
  # Return:
  #
  #  * [String] Time.now formatted as "YYYYMMDDHHMMSS"
  #
  def self.terse
    now.terse
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sixarm_ruby_time_terse-2.0.0 lib/sixarm_ruby_time_terse/time.rb
sixarm_ruby_time_terse-1.1.6 lib/sixarm_ruby_time_terse/time.rb
sixarm_ruby_time_terse-1.1.5 lib/sixarm_ruby_time_terse/time.rb
sixarm_ruby_time_terse-1.1.4 lib/sixarm_ruby_time_terse/time.rb