aboutsummaryrefslogtreecommitdiffstats
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* Specify encoding explicitly for sprintfNARUSE, Yui2019-09-191-1/+1
|
* Separate Time#inspect from to_s and show subsec [Feature #15958]NARUSE, Yui2019-09-191-3/+48
|
* Support timeout for AddrinfoMasaki Matsushita2019-09-101-0/+6
| | | | | | | | | | | | Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature. This commit is retry of 6382f5cc91ac9e36776bc854632d9a1237250da7. Test was failed on Solaris machines which don't have "http" in /etc/services. In this commit, use "ssh" instead.
* Revert "Support timeout for Addrinfo"Masaki Matsushita2019-09-091-6/+0
| | | | | This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7. test failed on Solaris.
* Support timeout for AddrinfoMasaki Matsushita2019-09-091-0/+6
| | | | | | | | Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature.
* rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平2019-08-271-1/+1
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_rescue / rb_rescue2, which revealed many arity / type mismatches.
* Refine time_to_rNobuyoshi Nakada2019-08-061-5/+16
| | | | | * time.c (time_to_r): get rid canonicalize and uncanonicalize one-denominator rational, by rb_time_unmagnify_to_rational.
* Predefine some IDsNobuyoshi Nakada2019-08-031-8/+7
|
* Document that Timezone argument for Time uses dst? if available [ci skip]Jeremy Evans2019-07-291-1/+4
|
* Initialize DST flagNobuyoshi Nakada2019-07-271-0/+13
| | | | | * time.c (zone_timelocal): initialize DST flag by asking the timezone object. [Bug #15988]
* Expanded buf to copy at onceNobuyoshi Nakada2019-07-171-6/+9
| | | | | | | Build dumped string from base packed data and extended year at once. Although currently ruby_marshal_write_long() never writes more than 5 bytes per its format specification, allocate `sizeof(long)+1` for the sanitation.
* Named the backward compatible dump sizeNobuyoshi Nakada2019-07-171-6/+8
|
* time.c (time_mdump): use another buffer for year_extendYusuke Endoh2019-07-151-3/+3
| | | | | ruby_marshal_write_long may write 9 bytes, but buf has only 8 bytes. So the buffer cannot be reused. This issue was found by Coverity Scan.
* Add a /* fall through */ commentYusuke Endoh2019-07-141-0/+1
|
* Marshal distant past/futureNobuyoshi Nakada2019-06-191-8/+67
| | | | [Feature #15160]
* [DOC] Use Rational literals than to_r in examplesNobuyoshi Nakada2019-05-241-3/+3
|
* Hoisted out ndigits_denominatorNobuyoshi Nakada2019-05-241-51/+24
| | | | | * time.c (ndigits_denominator): calculate the denominator for digits.
* * expand tabs.git2019-05-231-1/+1
|
* Add `Time#ceil`.manga_osyo2019-05-231-0/+62
| | | | Closes: https://github.com/ruby/ruby/pull/2133
* [DOC] Shorten examples for Time#{round,floor}Marcus Stollsteimer2019-05-181-12/+0
|
* [DOC] Improve documentation for Time#floorMarcus Stollsteimer2019-05-181-4/+2
| | | | Use numbers that are more illustrative for #floor.
* Add a pathologic checkNobuyoshi Nakada2019-05-041-0/+3
|
* * expand tabs.svn2019-04-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add `Time#floor`nobu2019-04-201-0/+70
| | | | | | | | | [Feature #15653] [Fix GH-2092] From: manga_osyo <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: added in: option to Time.nownobu2019-04-191-9/+28
| | | | | | | * time.c (time_s_now): added in: option to Time.now as well as Time.at. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] small improvementstomar2019-01-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: separate sign argumentnobu2019-01-131-8/+4
| | | | | | | * time.c (vtm_add_offset): separate sign argument to get rid of repeated negations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: do not set utc_offset in vtm_add_offsetnobu2019-01-131-2/+0
| | | | | | | | * time.c (vtm_add_offset): just add offset to other components only. removed subtraction of utc_offset as it is overwritten always immediately in callers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: update error message for invalid utc_offsetnobu2019-01-091-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: support military time zone namesnobu2019-01-071-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: UTC and Z timezones should be utcnobu2019-01-071-3/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: zone in fixoff modenobu2018-12-241-0/+1
| | | | | | | | | * time.c (time_set_utc_offset): reset zone when setting to fixoff mode. while previously TZMODE_SET_FIXOFF has reset it always, the zone is kept for loaded zone since r65025. [ruby-core:90627] [Bug #15439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Range check is only for interavalnobu2018-12-171-12/+18
| | | | | | | * time.c (time_timespec): range check is only for time interval value if time_t is signed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refine error message for time intervalnobu2018-12-161-4/+4
| | | | | | | | | * time.c (time_timespec): Time interval value can be zero, not only positive. [ruby-dev:50709] [Bug #15420] From: shuujii (Shuji KOBAYASHI) <shuujii@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] improve docs for tz argument of Time.newstomar2018-12-151-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: improve docs for Timestomar2018-12-131-44/+44
| | | | | | | * time.c: [DOC] fix typos, drop unnecessary `p' from code examples, add missing `#' for return values, other small improvements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Prefer rb_check_arity when 0 or 1 argumentsnobu2018-12-061-7/+3
| | | | | | | Especially over checking argc then calling rb_scan_args just to raise an ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Prefer rb_check_arity when 0 or 1 argumentsnobu2018-12-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: rescue find_timezone when loadingnobu2018-11-281-2/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Time.at in: tznobu2018-11-281-6/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Timezone at Time.atnobu2018-11-281-2/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Try Time.find_timezone to convert name to timezonenobu2018-11-281-17/+54
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Try Time.find_timezone to loadnobu2018-11-281-2/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Normalize month-mday before finding epochnaruse2018-11-251-0/+23
| | | | | | | Especially over the year 2038, 30 Feb and so on may cause odd behavior on validating found epoch with given year-month-day [Bug #15340] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Hide Time::TM as Time::tmnobu2018-11-041-55/+67
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] fix method names to refer class methods [ci skip]nobu2018-10-291-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: added Time::TM#+ and Time::TM#-nobu2018-10-281-4/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: ignore 7th argnobu2018-10-281-21/+19
| | | | | | | * time.c (tm_initialize): allow 7th argument as well as Time#initialize, but just ignore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] add description and fix markups [ci skip]nobu2018-10-281-12/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] fix rdoc-ref [ci skip]nobu2018-10-281-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e