aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time/conversions.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-2/+2
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Add `rfc3339` aliases to `xmlschema`Andrew White2017-03-031-0/+3
| | | | | For naming consistency when using the RFC 3339 profile of ISO 8601 in applications.
* modernizes hash syntax in activesupportXavier Noria2016-08-061-10/+10
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-9/+9
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* fixes #21815Maarten Jacobs2015-10-161-0/+1
| | | | | | | | | | | | | | | The default timestamp used for AR is `updated_at` in nanoseconds! (:nsec) This causes issues on any machine that runs an OS that supports nanoseconds timestamps, i.e. not-OS X, where the cache_key of the record persisted in the database (milliseconds precision) is out-of-sync with the cache_key in the ruby VM. This commit adds: A test that shows the issue, it can be found in the separate file `cache_key_test.rb`, because - model couldn't be defined inline - transactional testing needed to be turned off to get it to pass the MySQL tests This seemed cleaner than putting it in an existing testcase file. It adds :usec as a dateformat that calculates datetime in microseconds It sets precision of cache_key to :usec instead of :nsec, as no db supports nsec precision on timestamps
* Fix Time.now format in documentationTanmay Sinha2015-10-041-1/+1
|
* Update docs for `formatted_offset` Ronak Jangir2015-09-291-1/+2
| | | Output of `formatted_offset` is depends on input so it’s not always in +HH:MM format. Possible outputs are “+5:30”, “+530” or provided alternate UTC string [ci skip]
* [ci skip] builtin -> built-inAkshay Vishnoi2014-04-201-1/+1
|
* Fix handling of offsets with Time#to_s(:iso8601)Andrew White2013-07-291-1/+2
| | | | | | Use a lambda to ensure that the generated string respects the offset of the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601) for completeness.
* Add Time#to_s(:iso8601) for easy conversion of times to the iso8601 format ↵David Heinemeier Hansson2013-07-281-1/+2
| | | | for easy Javascript date parsing
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-12/+12
|
* Increase `AR#cache_key` precision to nanosecondsJamie Gaskins2012-05-191-0/+1
|
* String quotes and trailing spacesAlexey Gaziev2012-04-291-6/+6
|
* AS core_ext refactoringAlexey Gaziev2012-04-291-2/+8
|
* to_date, to_time, and to_datetime Time methods present in ruby 1.9Sergey Nartimov2012-01-131-28/+0
|
* no more need to make Time#to_date and Time#to_datetime publicSergey Nartimov2011-12-221-1/+0
| | | | they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180)
* Revert "Ruby 1.8.7+ provides to_date/to_datetime, AS just makes them ↵Chris Griego2011-08-311-0/+22
| | | | | | | | public." to support date implementations without private to_date/to_datetime on Time (home_run). This reverts commit 080345baca1076a9788dff4803153600aec31f86. Signed-off-by: José Valim <jose.valim@gmail.com>
* Ruby 1.8.7+ provides to_date/to_datetime, AS just makes them public.John Firebaugh2011-02-031-22/+0
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* In AS, only inflector/methods is need in proxy_wrappers.rb, as well as date, ↵Josh Kalderimis2011-01-121-1/+1
| | | | | | date_time, and time conversions.rb. This fixes an issue when requiring json and AS saying that i18n is also required. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fix time.to_formatted_time(:time) exampleAditya Sanghi2010-10-131-2/+2
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* avoid active_support/core_ext/time/conversions.rb warningsSantiago Pastorino2010-03-211-0/+1
| | | | | | [#4250 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Check for date/time methods that moved upstream in 1.9Jeremy Kemper2009-05-071-1/+1
|
* Prefer behavior check to RUBY_VERSION to catch 1.8 backportsJeremy Kemper2009-04-291-2/+2
|
* Convert Time conversions extension module to class reopenJeremy Kemper2009-03-281-83/+77
|
* Move Numeric#to_utc_offset_s to TimeZone.seconds_to_utc_offsetJeremy Kemper2009-03-231-1/+1
|
* Time#to_s(:rfc822) uses #formatted_offset instead of unreliable and ↵Zachary Zolton2009-02-091-1/+1
| | | | non-standard %z directive [#1899 state:resolved]
* Merge docrails changesPratik Naik2008-07-281-0/+1
|
* Merge docrails.Pratik Naik2008-05-251-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve documentation.Pratik Naik2008-04-051-27/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor Time and DateTime #to_formatted_s: use ternary instead of nested ↵Geoff Buesing2008-01-231-9/+2
| | | | | | if/else git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8699 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time and DateTime #formatted_offset, for outputting +HH:MM utc offset ↵Geoff Buesing2008-01-231-0/+8
| | | | | | strings with cross-platform consistency git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify to_formatted_s docs. Closes #10747 [Jeremy Kemper]Jeremy Kemper2008-01-091-24/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8608 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document date and time to_formatted_s. Closes #10747 [leethal]Jeremy Kemper2008-01-091-2/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8606 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved the caching stores from ActionController::Caching::Fragments::* to ↵David Heinemeier Hansson2008-01-031-0/+1
| | | | | | ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH] Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH] All fragment cache keys are now by default prefixed with the 'views/' namespace [DHH] Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH] Added ActiveSupport::Gzip.decompress/compress(source) as an easy wrapper for Zlib [Tobias Luetke] Included MemCache-Client to make the improved ActiveSupport::Cache::MemCacheStore work out of the box [Bob Cottrell, Eric Hodel] Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Enhance documentation for Active Support's Time Conversion functions. ↵Michael Koziarski2007-12-051-3/+46
| | | | | | [rsanheim, jeremymcanally, chuyeow] Closes #7164 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Honor Ruby's default calendar reform setting when creating DateTime objects ↵Geoff Buesing2007-11-241-1/+1
| | | | | | via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Date/Time/DateTime Ruby 1.9 compatJeremy Kemper2007-09-271-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Some 1.9 forward compatibilityJeremy Kemper2007-09-141-3/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime#to_time converts to Time unless out of range. Date#to_datetime and ↵Jeremy Kemper2007-05-301-1/+2
| | | | | | Date#to_s(:rfc822). Closes #8512. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Date, Time, and DateTime support formatting blocks in addition to strftime ↵Jeremy Kemper2007-05-251-9/+18
| | | | | | strings. Introduce :long_ordinal format, e.g. 'February 21st, 2005'. Closes #8191. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6844 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#since overflows to DateTime. Introduce Time#to_datetime. Closes #7715.Jeremy Kemper2007-03-051-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active ↵Jeremy Kemper2007-02-011-3/+0
| | | | | | Support. Make it public to preserve compatibility. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6099 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Time#to_s(:time) which will just return H:M, like 17:44 [DHH]David Heinemeier Hansson2006-11-251-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5628 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace Ruby's deprecated append_features in favor of included. [Marcel ↵Marcel Molina2006-04-291-2/+1
| | | | | | Molina Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#xmlschema is only available when you've required 'time'. Add a unit ↵Michael Koziarski2006-03-151-0/+1
| | | | | | test to catch regressions. [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3880 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace '%e' from long and short time formats as Windows does not support ↵Marcel Molina2005-10-101-2/+2
| | | | | | it. Closes #2344. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2512 5ecf4fe2-1ee6-0310-87b1-e25e094e27de