- Git: https://github.com/SixArm/sixarm_ruby_time_stamp
- Doc: http://sixarm.com/sixarm_ruby_time_stamp/doc
- Gem: https://rubygems.org/gems/sixarm_ruby_time_stamp
- Contact: Joel Parker Henderson, joel@sixarm.com
- Project: changes, license, contributing.
Provides timestamp methods Time.stamp and Time#stamp
For docs go to http://sixarm.com/sixarm_ruby_time_stamp/doc
Want to help? We're happy to get pull requests.
To install this gem in your shell or terminal:
gem install sixarm_ruby_time_stamp
To add this gem to your Gemfile:
gem 'sixarm_ruby_time_stamp'
To require the gem in your code:
require 'sixarm_ruby_time_stamp'
Generate a time stamp using the defaults:
Time.stamp #=> "2020-12-31T12:59:59.000000000Z"
Defaults:
-
The current time
-
The UTC time zone a.k.a. Zulu time zone a.k.a. "Z" time zome.
-
Default RFC ISO format: "%Y-%m-%dT%H:%M:%S.%NZ'"
-
Nanosecond precision
Set a different format:
Time.stamp_format = "%M/%D %H:%M"
Time.stamp #=> "12/31 12:59"
The same methods are also available for an instance:
t = Time.now
t.stamp #=> "2020-12-31T12:59:59.000000000Z"
t.stamp_format = "%M/%D %H:%M"
t.stamp #=> "12/31 12:59"
