https://github.com/sixarm/sixarm_ruby_time_terse
SixArm.com → Ruby → Time.terse method for timestamping
https://github.com/sixarm/sixarm_ruby_time_terse
gem iso rfc ruby time timestamp
Last synced: 11 months ago
JSON representation
SixArm.com → Ruby → Time.terse method for timestamping
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_time_terse
- Owner: SixArm
- License: other
- Created: 2011-11-08T03:12:43.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T09:21:21.000Z (about 1 year ago)
- Last Synced: 2025-04-14T10:31:04.840Z (about 1 year ago)
- Topics: gem, iso, rfc, ruby, time, timestamp
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 357 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
Time.terse method for timestamping
[](http://badge.fury.io/rb/sixarm_ruby_time_terse)
[](https://travis-ci.org/SixArm/sixarm_ruby_time_terse)
[](https://codeclimate.com/github/SixArm/sixarm_ruby_time_terse/maintainability)
* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).
## Introduction
Provides timestamp methods Time.terse and Time#terse
For docs go to
Want to help? We're happy to get pull requests.
## Install
### Gem
To install this gem in your shell or terminal:
gem install sixarm_ruby_time_terse
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_time_terse'
### Require
To require the gem in your code:
require 'sixarm_ruby_time_terse'
## Examples
Generate a time terse string using the defaults:
Time.terse #=> "20201231125959000000000"
Defaults:
* The current time
* The UTC time zone a.k.a. Zulu time zone a.k.a. "Z" time zome.
* Terse format: "%Y%m%d%H%M%S%N"
* Nanosecond precision
Set a different format:
Time.terse_format = "%M%D%H%M"
Time.terse #=> "12311259"
The same methods are also available for an instance:
t = Time.now
t.terse #=> "20201231125959000000000"
t.terse_format = "%M%D%H%M"
t.terse #=> "12311259"