Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/strptime
. To experiment with that code, run bin/console
for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
Add this line to your application's Gemfile:
gem 'strptime'
And then execute:
$ bundle
Or install it yourself as:
$ gem install strptime
require 'strptime'
parser = Strptime.new('%Y-%m-%dT%H:%M:%S%z')
parser.exec('2015-12-25T12:34:56+09') #=> 2015-12-25 12:34:56 +09:00
parser.execi('2015-12-25T12:34:56+09') #=> 1451014496
require 'strptime'
now = Time.now
formatter = Strftime.new('%Y-%m-%dT%H:%M:%S.%L %z')
formatter.exec(now) # 2017-12-29T07:24:31.505 +0900
formatter.execi(now.to_i) # 2017-12-28T22:24:31.000 +0000
- Fork it ( https://github.com/nurse/strptime/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request