aboutsummaryrefslogtreecommitdiffstats
path: root/lib/time.rb
Commit message (Collapse)AuthorAgeFilesLines
* * lib/time.rb: revert r54167 because it would breaksonots2016-04-191-13/+7
| | | | | | | | backward compatibilities, and it is documented that Time.parse does not take into account time zone abbreations other than ones described in RFC 822 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (parse, strptime): Fix Time.parse/strptime does notsonots2016-03-171-7/+13
| | | | | | | have compatibility with DateTime.parse/strptime in terms of parsing timezone [Bug #12190] [Fix GH-1297] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: Use "<<" to reduce string allocation.akr2015-11-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: Specify frozen_string_literal: true.akr2015-11-141-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (strptime): Support %s.%N.akr2015-03-011-1/+7
| | | | | | | | [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC]akr2015-01-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: [DOC] Clarify %Y in strftime, which can accept any digitszzak2014-07-271-1/+1
| | | | | | | | and will output at least 4 digits as the year. Reported by Yury Trofimenko [Bug #8941] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix `Time.parse` for out of range arguments with an offsetnobu2014-07-191-1/+2
| | | | | | | | | | | | * lib/time.rb (Time#apply_offset): Guards against a `nil` return value from `Time.month_days` when offsetting date. Out of range values are then caught when `Time.utc` is called (as usual). Previously a `nil` return value from `Time.month_days` would have the `<` operator called on it, and raise `NoMethodError`. [fix GH-667] * lib/rdoc/parser/changelog.rb (RDoc#parse_entries): fix dirty hack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.make_time): Adjust the time zone of "now".akr2014-05-061-2/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.make_time): Argument validation code moved fromakr2014-05-061-9/+7
| | | | | | | | Time.parse and Time.strptime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Use EST for previous documentation fix.akr2014-05-061-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.parse): [DOC] Fix an example in the documentation.akr2014-05-061-7/+7
| | | | | | | | | Reported by Marcus Stollsteimer. [ruby-core:60778] [Bug #9521] and [ruby-core:61718] [Bug #9682] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.strptime): Raise ArgumentError if Date._strptimeakr2014-05-051-0/+3
| | | | | | | | | doesn't extract date information. Reported by tadayoshi funaba. [ruby-core:62349] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update a comment.akr2014-05-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment.akr2014-05-041-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.force_zone!): Use usual local time if it hasakr2014-05-041-1/+4
| | | | | | | | expected offset from UTC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.force_zone!): New private method.akr2014-05-041-8/+15
| | | | | | | | | | | | | (Time.make_time): Use Time.force_zone!. (Time.strptime): Ditto. (Time.rfc2822): Ditto. (Time.xmlschema): Ditto. * lib/rss/rss.rb (Time.w3cdtf): Use Time.force_zone!. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.httpdate): Always return a UTC Time object.akr2014-05-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.make_time): Refactored.akr2014-05-031-5/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.rfc2822): Fix year completion.akr2014-05-031-12/+17
| | | | | | | | | Produce fixed-offset time object if appropriate. (Time.xmlschema): Produce fixed-offset time object if appropriate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (make_time): Produce fixed-offset time object ifakr2014-05-031-4/+12
| | | | | | | | | | | | appropriate. (Time.strptime): Use d[:zone] instead of d[:offset]. * lib/rss/rss.rb (Time.w3cdtf): Produce fixed-offset time object if appropriate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.strptime): Use d[:offset] if d[:seconds] is notakr2014-05-031-6/+6
| | | | | | | | | given. Reported by tadayoshi funaba. [ruby-core:62322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: [DOC] Fix timezone in example of Time.parse [Bug #9521]zzak2014-03-161-1/+1
| | | | | | | Based on patch by @stomar [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: [DOC] Fix typoa_matsuda2013-12-261-1/+1
| | | | | | | s/formating/formatting/ [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.strptime): Time.strptime('0', '%s') returns localakr2013-10-071-2/+5
| | | | | | | time Time object as Ruby 2.0 and before. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: [DOC] typo in Time.rb overview by @srt32 [Fixes GH-416]zzak2013-10-071-1/+1
| | | | | | | https://github.com/ruby/ruby/pull/416 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.strptime): Use :offset.akr2013-10-071-1/+2
| | | | | | | | Patch by Felipe Contreras. [ruby-core:57694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: [DOC] Correcting rdoc visibility of time.rb constantszzak2013-08-111-16/+5
| | | | | | | Reported by Tanaka Akira [ruby-core:56517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: [DOC] Document constants by @markijbema [Fixes GH-377]zzak2013-08-101-0/+13
| | | | | | | https://github.com/ruby/ruby/pull/377 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time#xmlschema): use strftime specifiers instead ofnobu2012-02-281-13/+5
| | | | | | | fractional exponential calcuation which yields undesirable result. [ruby-core:42997][Bug #6100] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: Clean up Time documentation. Patch by Jake Goulding.drbrain2011-10-061-58/+71
| | | | | | | [Ruby 1.9 - Bug #5416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (Init_Time): Improve Time documentation. Patch by Shanedrbrain2011-10-061-34/+121
| | | | | | | | | Emmons. [Ruby 1.9 - Bug #5404] * lib/time.rb: Improve time.rb documentation including Time.strptime. Patch by Shane Emmons. [Ruby 1.9 - Bug #5402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.naruse2011-10-041-3/+7
| | | | | | Reported by Christopher Eberz. [ruby-core:39903] Bug #5399 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* duplicated statement removed in comment.akr2011-08-161-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (xmlschema): avoid passing any negative numbers.tadf2011-05-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb: require 'date'.tadf2011-04-241-1/+1
| | | | | | | * ext/date/lib/date/format.rb: removed require line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update comment.akr2011-01-121-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-11-261-0/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c: %Y format a year with 4 digits at least.akr2009-11-241-6/+6
| | | | | | | | * lib/time.rb: format a year with 4 digits at least. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-04-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.parse): use year completion in Date._parse.akr2009-04-221-16/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time#rfc2822): pad leading zeros for year.akr2009-04-211-3/+3
| | | | | | | | | (Time#httpdate): ditto. (Time#xmlschema): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time#xmlschema): use subsec instead of nsec.akr2009-04-211-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_arg): use the year argument as-is. [ruby-dev:38194]akr2009-04-211-1/+15
| | | | | | | | * lib/time.rb (Time.parse): interpret small year 0..99 as 1950..2049. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-02-151-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/time.rb (Time.parse): raise ArgumentError if Date._parse don'takr2009-02-141-3/+8
| | | | | | | | extract date information. [ruby-core:20912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove Id keyword.akr2009-02-141-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_time.rb: extracted from lib/time.rb.akr2009-02-141-364/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment and test.akr2008-11-261-2/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e