summaryrefslogtreecommitdiff
path: root/time.c
AgeCommit message (Collapse)Author
2019-10-06time.c: Fix some bugs about WIDEVALUEYusuke Endoh
WIDEVALUE differs from VALUE in 32bit platform, but some codes assume that they are the same. There is `#define STRUCT_WIDEVAL` mode to check the consistency. This change allows to build with STRUCT_WIDEVAL.
2019-09-19Specify encoding explicitly for sprintfNARUSE, Yui
2019-09-19Separate Time#inspect from to_s and show subsec [Feature #15958]NARUSE, Yui
2019-09-10Support timeout for AddrinfoMasaki Matsushita
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.
2019-09-09Revert "Support timeout for Addrinfo"Masaki Matsushita
This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7. test failed on Solaris.
2019-09-09Support timeout for AddrinfoMasaki Matsushita
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.
2019-08-27rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平
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.
2019-08-06Refine time_to_rNobuyoshi Nakada
* time.c (time_to_r): get rid canonicalize and uncanonicalize one-denominator rational, by rb_time_unmagnify_to_rational.
2019-08-03Predefine some IDsNobuyoshi Nakada
2019-07-29Document that Timezone argument for Time uses dst? if available [ci skip]Jeremy Evans
2019-07-27Initialize DST flagNobuyoshi Nakada
* time.c (zone_timelocal): initialize DST flag by asking the timezone object. [Bug #15988]
2019-07-17Expanded buf to copy at onceNobuyoshi Nakada
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.
2019-07-17Named the backward compatible dump sizeNobuyoshi Nakada
2019-07-15time.c (time_mdump): use another buffer for year_extendYusuke Endoh
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.
2019-07-14Add a /* fall through */ commentYusuke Endoh
2019-06-19Marshal distant past/futureNobuyoshi Nakada
[Feature #15160]
2019-05-24[DOC] Use Rational literals than to_r in examplesNobuyoshi Nakada
2019-05-24Hoisted out ndigits_denominatorNobuyoshi Nakada
* time.c (ndigits_denominator): calculate the denominator for digits.
2019-05-23* expand tabs.git
2019-05-23Add `Time#ceil`.manga_osyo
Closes: https://github.com/ruby/ruby/pull/2133
2019-05-18[DOC] Shorten examples for Time#{round,floor}Marcus Stollsteimer
2019-05-18[DOC] Improve documentation for Time#floorMarcus Stollsteimer
Use numbers that are more illustrative for #floor.
2019-05-04Add a pathologic checkNobuyoshi Nakada
2019-04-20* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Add `Time#floor`nobu
[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
2019-04-19time.c: added in: option to Time.nownobu
* 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
2019-01-20time.c: [DOC] small improvementstomar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-13time.c: separate sign argumentnobu
* 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
2019-01-13time.c: do not set utc_offset in vtm_add_offsetnobu
* 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
2019-01-09time.c: update error message for invalid utc_offsetnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07time.c: support military time zone namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07time.c: UTC and Z timezones should be utcnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-24time.c: zone in fixoff modenobu
* 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
2018-12-17Range check is only for interavalnobu
* 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
2018-12-16Refine error message for time intervalnobu
* 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
2018-12-15time.c: [DOC] improve docs for tz argument of Time.newstomar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-13time.c: improve docs for Timestomar
* 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
2018-12-06Prefer rb_check_arity when 0 or 1 argumentsnobu
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
2018-12-04Prefer rb_check_arity when 0 or 1 argumentsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28time.c: rescue find_timezone when loadingnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28Time.at in: tznobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28Timezone at Time.atnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28Try Time.find_timezone to convert name to timezonenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28Try Time.find_timezone to loadnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-25Normalize month-mday before finding epochnaruse
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
2018-11-04Hide Time::TM as Time::tmnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-29time.c: [DOC] fix method names to refer class methods [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28time.c: added Time::TM#+ and Time::TM#-nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28time.c: ignore 7th argnobu
* 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
2018-10-28time.c: [DOC] add description and fix markups [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e