summaryrefslogtreecommitdiff
path: root/time.c
AgeCommit message (Collapse)Author
2023-01-18merge revision(s) ↵NARUSE, Yui
291a4098cf649c027cb50c16b872455f26ad1dfb,5be0d42d2c4dc765230c76738289560f9ee37f09: [Backport #19296] Add missing assertion --- test/ruby/test_time.rb | 3 +++ 1 file changed, 3 insertions(+) [Bug #19296] Precheck bits of time components --- test/ruby/test_time.rb | 15 +++++++++++++++ time.c | 14 ++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-)
2023-01-17merge revision(s) 542e984d82fa25098eb15398d716d907acc52b93: [Backport #19292]NARUSE, Yui
[Bug #19292] Re-initialize tm when wday or yday is not set --- test/ruby/test_time.rb | 3 ++- time.c | 31 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-)
2022-12-22Update documentation about Time#deconstruct_keysKazuki Tsujimoto
2022-12-21[DOC] fix unintentional verbatimNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6975
2022-12-19Fix guess_diff typeNobuyoshi Nakada
`unsigned_time_t` has the same size as `time_t`, but it doesn't mean these types are same except for signedness. For instance, while `long` and `long long` has the same size and `time_t` is defined as the latter on 64bit OpenBSD, `unsigned_time_t` has been defined as `long`.
2022-12-16[Feature #18033] Parse more strictly conformant with ISO-8601Nobuyoshi Nakada
* 4-digits or more is required as year * Minutes and seconds parts are not ommittable Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Make more conformant with C standardNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Add `precision:` optionNobuyoshi Nakada
Which limits the precision of subsecond. Defaulted to 9, that means nanosecond. Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] More strict checksNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Name a magic numberNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-12-16[Feature #18033] Make Time.new parse time stringsNobuyoshi Nakada
`Time.new` now parses strings such as the result of `Time#inspect` and restricted ISO-8601 formats. Notes: Merged: https://github.com/ruby/ruby/pull/4825
2022-11-22Add Time#deconstruct_keyszverok
Notes: Merged: https://github.com/ruby/ruby/pull/6594
2022-11-16Using UNDEF_P macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/6721
2022-11-15Re-order checks for colons in UTC offsetNobuyoshi Nakada
2022-11-07[Bug #19106] Normalize time at 24:00:00 with a timezone objectNobuyoshi Nakada
2022-10-11[DOC] use the local rdoc reference than the external URINobuyoshi Nakada
2022-09-03[DOC] Remove extra page-dir prefix to fix broken linkNobuyoshi Nakada
2022-09-03[DOC] Enhanced RDoc for Time (#6320)Burdette Lamar
Treats: #yday #dst? #zone #to_a #strftime Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-09-02Enhanced RDoc for Tim[DOC] (#6319)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-31[DOC] Enhanced RDoc for Time (#6308)Burdette Lamar
More on timezones. Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-28[DOC] Enhanced RDoc for Time (#6294)Burdette Lamar
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-25[DOC] Enhanced RDoc for Time (#6277)Burdette Lamar
Deletes the :include: files in doc/time, which became no longer workable when @nobu pointed out that some (but not all) creator methods accept string values as well as integer-like values. Changes to methods: Time.utc Time.local Time.at Time.new Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-26[DOC] Tell RDoc aliases of singleton classNobuyoshi Nakada
Since RDoc C parser cannot capture aliases which are using an expression other than a single variable as the class, use an intermediate variable for the singleton class.
2022-08-23[DOC] Remove extra page-dir prefixNobuyoshi Nakada
2022-08-22[DOC] Enhanced RDoc for Time (#6267)Burdette Lamar
Treats: #utc #getlocal #getutc #ctime #to_s #inspect Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-08-22[DOC] Remove extra page-dir prefixNobuyoshi Nakada
2022-08-21[DOC] Enhanced RDoc for Time (#6255)Burdette Lamar
Treats: #utc #hash #localtime Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-07-21Expand tabs [ci skip]Takashi Kokubun
[Misc #18891] Notes: Merged: https://github.com/ruby/ruby/pull/6094
2022-07-18[Bug #18922] Normalize time at 24:00:00 UTCNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6146 Merged-By: nobu <nobu@ruby-lang.org>
2022-07-12[DOC] Enhanced RDoc for Time (#6118)Burdette Lamar
Treats: ::utc ::local #to_i #to_f #to_r #usec #nsec #subsec #<=> #eql? Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2022-05-26Using TZMODE_SET_LOCALTIME macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/5937
2022-04-09[DOC]Some link prefix replaceS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/5783
2022-02-28Fix a typo of macro nameNobuyoshi Nakada
When the date is 28 Feb in the local timezone and 27 in the UTC, the leap second info is wrongly calculated, and the Time for 1 Mar created with a timezone resulted in an invalid date, 30 Feb.
2022-01-12Speed up and avoid kwarg hash alloc in Time.nowJohn Hawthorn
Previously Time.now was switched to use Time.new as it added support for the in: argument. Unfortunately because Class#new is a cfunc this requires always allocating a Hash. This commit switches Time.now back to using a builtin time_s_now. This avoids the extra Hash allocation and is about 3x faster. $ benchmark-driver -e './ruby;3.1::~/.rubies/ruby-3.1.0/bin/ruby;3.0::~/.rubies/ruby-3.0.2/bin/ruby' benchmark/time_now.yml Warming up -------------------------------------- Time.now 6.704M i/s - 6.710M times in 1.000814s (149.16ns/i, 328clocks/i) Time.now(in: "+09:00") 2.003M i/s - 2.112M times in 1.054330s (499.31ns/i) Calculating ------------------------------------- ./ruby 3.1 3.0 Time.now 7.693M 2.763M 6.394M i/s - 20.113M times in 2.614428s 7.278710s 3.145572s Time.now(in: "+09:00") 2.030M 1.260M 1.617M i/s - 6.008M times in 2.960132s 4.769378s 3.716537s Comparison: Time.now ./ruby: 7693129.7 i/s 3.0: 6394109.2 i/s - 1.20x slower 3.1: 2763282.5 i/s - 2.78x slower Time.now(in: "+09:00") ./ruby: 2029757.4 i/s 3.0: 1616652.3 i/s - 1.26x slower 3.1: 1259776.2 i/s - 1.61x slower Notes: Merged: https://github.com/ruby/ruby/pull/5429
2021-12-25Raise proper exception when month argument is not a nameNobuyoshi Nakada
https://bugs.ruby-lang.org/issues/17485#change-89871 Notes: Merged: https://github.com/ruby/ruby/pull/5344
2021-12-09Check month overflow when marshalNobuyoshi Nakada
https://hackerone.com/reports/1244185 Notes: Merged: https://github.com/ruby/ruby/pull/5238
2021-11-15Use `Primitive.mandatory_only?` for `Time.at`Koichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/5112
2021-11-10Tentative fix of subsec to `Time.at` [Bug #18293]Nobuyoshi Nakada
2021-11-10Simplify default values of `Time.at` [Bug #18293]Nobuyoshi Nakada
2021-10-28Fix leap day with UTC offset [Bug #18274]Nobuyoshi Nakada
`struct vtm::year` is a Ruby integer instance, but not a C integer type. Notes: Merged: https://github.com/ruby/ruby/pull/5041
2021-10-14Prefer the reentrant versions of gmtime and localtimeNobuyoshi Nakada
2021-09-18Include the invalid value in invalid_utc_offset errorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4864
2021-09-16Remove unneeded ruby_reset_leap_second_info function declaration (#4824)S.H
Notes: Merged-By: nurse <naruse@airemix.jp>
2021-09-11Using RB_BIGNUM_TYPE_P macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4805
2021-09-10include/ruby/internal/intern/time.h: add doxygen卜部昌平
Must not be a bad idea to improve documents. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-05Replace RBOOL macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4791
2021-08-02Using RBOOL macroS.H
Notes: Merged: https://github.com/ruby/ruby/pull/4695 Merged-By: nobu <nobu@ruby-lang.org>
2021-06-27Added macros for days in monthNobuyoshi Nakada
2021-06-27Shrink monthly tablesNobuyoshi Nakada
2021-06-22[Documentation] Fix typo, formatting in `time.c`Anton Rieder
Backticks do not result in code formatting. Notes: Merged: https://github.com/ruby/ruby/pull/4594