Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/sixarm_ruby_time_terse/time.rb
Overview
Time class extensions.
Class Method Summary collapse
-
.terse ⇒ Object
The time now, in UTC, using a terse format “YYYYMMDDHHMMSS”.
Instance Method Summary collapse
-
#terse ⇒ Object
The time, in UTC, using a terse format “YYYYMMDDHHMMSS”.
Class Method Details
.terse ⇒ Object
The time now, in UTC, using a terse format “YYYYMMDDHHMMSS”.
Example:
Time.terse
=> "20151231125959"
Return:
* [String] Time.now formatted as "YYYYMMDDHHMMSS"
34 35 36 |
# File 'lib/sixarm_ruby_time_terse/time.rb', line 34 def self.terse now.terse end |
Instance Method Details
#terse ⇒ Object
The time, in UTC, using a terse format “YYYYMMDDHHMMSS”.
Example:
Time.now.terse
=> "20151231125959"
Return:
* [String] time formatted as "YYYYMMDDHHMMSS"
19 20 21 |
# File 'lib/sixarm_ruby_time_terse/time.rb', line 19 def terse getutc.strftime('%Y%m%d%H%M%S') end |