summaryrefslogtreecommitdiff
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* Update documentation about Time#deconstruct_keysKazuki Tsujimoto2022-12-221-1/+3
|
* [DOC] fix unintentional verbatimNobuyoshi Nakada2022-12-211-1/+1
|
* Fix guess_diff typeNobuyoshi Nakada2022-12-191-1/+1
| | | | | | | | `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`.
* [Feature #18033] Parse more strictly conformant with ISO-8601Nobuyoshi Nakada2022-12-161-5/+10
| | | | | * 4-digits or more is required as year * Minutes and seconds parts are not ommittable
* [Feature #18033] Make more conformant with C standardNobuyoshi Nakada2022-12-161-2/+3
|
* [Feature #18033] Add `precision:` optionNobuyoshi Nakada2022-12-161-24/+55
| | | | | Which limits the precision of subsecond. Defaulted to 9, that means nanosecond.
* [Feature #18033] More strict checksNobuyoshi Nakada2022-12-161-9/+27
|
* [Feature #18033] Name a magic numberNobuyoshi Nakada2022-12-161-4/+8
|
* [Feature #18033] Make Time.new parse time stringsNobuyoshi Nakada2022-12-161-1/+110
| | | | | `Time.new` now parses strings such as the result of `Time#inspect` and restricted ISO-8601 formats.
* Add Time#deconstruct_keyszverok2022-11-221-0/+108
|
* Using UNDEF_P macroS-H-GAMELINKS2022-11-161-8/+8
|
* Re-order checks for colons in UTC offsetNobuyoshi Nakada2022-11-151-8/+8
|
* [Bug #19106] Normalize time at 24:00:00 with a timezone objectNobuyoshi Nakada2022-11-071-8/+16
|
* [DOC] use the local rdoc reference than the external URINobuyoshi Nakada2022-10-111-1/+1
|
* [DOC] Remove extra page-dir prefix to fix broken linkNobuyoshi Nakada2022-09-031-1/+1
|
* [DOC] Enhanced RDoc for Time (#6320)Burdette Lamar2022-09-031-231/+36
| | | | | | | | | Treats: #yday #dst? #zone #to_a #strftime
* Enhanced RDoc for Tim[DOC] (#6319)Burdette Lamar2022-09-021-158/+200
|
* [DOC] Enhanced RDoc for Time (#6308)Burdette Lamar2022-08-311-2/+2
| | | More on timezones.
* [DOC] Enhanced RDoc for Time (#6294)Burdette Lamar2022-08-281-16/+21
|
* [DOC] Enhanced RDoc for Time (#6277)Burdette Lamar2022-08-251-47/+98
| | | | | | | | | | 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
* [DOC] Tell RDoc aliases of singleton classNobuyoshi Nakada2022-08-261-3/+4
| | | | | | 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.
* [DOC] Remove extra page-dir prefixNobuyoshi Nakada2022-08-231-1/+1
|
* [DOC] Enhanced RDoc for Time (#6267)Burdette Lamar2022-08-221-61/+63
| | | | | | | | | | Treats: #utc #getlocal #getutc #ctime #to_s #inspect
* [DOC] Remove extra page-dir prefixNobuyoshi Nakada2022-08-221-1/+1
|
* [DOC] Enhanced RDoc for Time (#6255)Burdette Lamar2022-08-211-29/+31
| | | | | | | Treats: #utc #hash #localtime
* Expand tabs [ci skip]Takashi Kokubun2022-07-211-264/+264
| | | | [Misc #18891]
* [Bug #18922] Normalize time at 24:00:00 UTCNobuyoshi Nakada2022-07-181-0/+14
|
* [DOC] Enhanced RDoc for Time (#6118)Burdette Lamar2022-07-121-98/+82
| | | | | | | | | | | | | | Treats: ::utc ::local #to_i #to_f #to_r #usec #nsec #subsec #<=> #eql?
* Using TZMODE_SET_LOCALTIME macroS-H-GAMELINKS2022-05-261-6/+6
|
* [DOC]Some link prefix replaceS-H-GAMELINKS2022-04-091-1/+1
|
* Fix a typo of macro nameNobuyoshi Nakada2022-02-281-1/+1
| | | | | | 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.
* Speed up and avoid kwarg hash alloc in Time.nowJohn Hawthorn2022-01-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Raise proper exception when month argument is not a nameNobuyoshi Nakada2021-12-251-9/+3
| | | | https://bugs.ruby-lang.org/issues/17485#change-89871
* Check month overflow when marshalNobuyoshi Nakada2021-12-091-1/+6
| | | | https://hackerone.com/reports/1244185
* Use `Primitive.mandatory_only?` for `Time.at`Koichi Sasada2021-11-151-0/+6
|
* Tentative fix of subsec to `Time.at` [Bug #18293]Nobuyoshi Nakada2021-11-101-1/+1
|
* Simplify default values of `Time.at` [Bug #18293]Nobuyoshi Nakada2021-11-101-3/+3
|
* Fix leap day with UTC offset [Bug #18274]Nobuyoshi Nakada2021-10-281-1/+2
| | | | | `struct vtm::year` is a Ruby integer instance, but not a C integer type.
* Prefer the reentrant versions of gmtime and localtimeNobuyoshi Nakada2021-10-141-0/+4
|
* Include the invalid value in invalid_utc_offset errorNobuyoshi Nakada2021-09-181-15/+17
|
* Remove unneeded ruby_reset_leap_second_info function declaration (#4824)S.H2021-09-161-1/+0
|
* Using RB_BIGNUM_TYPE_P macroS-H-GAMELINKS2021-09-111-8/+8
|
* include/ruby/internal/intern/time.h: add doxygen卜部昌平2021-09-101-5/+0
| | | | Must not be a bad idea to improve documents. [ci skip]
* Replace RBOOL macroS-H-GAMELINKS2021-09-051-1/+1
|
* Using RBOOL macroS.H2021-08-021-4/+3
|
* Added macros for days in monthNobuyoshi Nakada2021-06-271-13/+8
|
* Shrink monthly tablesNobuyoshi Nakada2021-06-271-6/+6
|
* [Documentation] Fix typo, formatting in `time.c`Anton Rieder2021-06-221-2/+2
| | | Backticks do not result in code formatting.
* Make frozen Time Ractor-shareableNobuyoshi Nakada2021-06-181-1/+2
|
* time.c: Check if defined(RUBY_MSVCRT_VERSION) to build on SolarisYusuke Endoh2021-06-141-1/+1
| | | | Fixes [Bug #17947]