sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

DateTime.civil_from_format

Returns DateTime with local offset for given year if format is local else
offset is zero.

  DateTime.civil_from_format :local, 2012
  # => Sun, 01 Jan 2012 00:00:00 +0300
  DateTime.civil_from_format :local, 2012, 12, 17
  # => Mon, 17 Dec 2012 00:00:00 +0000

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/date_time/conversions.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-DateTime-civil_from_format-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/date_time/conversions.rbgit commit -m "better docs for DateTime.civil_from_format"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-DateTime-civil_from_format-for-pr

hub pull-request


# Celebrate!