summaryrefslogtreecommitdiff
path: root/test/ruby/test_time.rb
AgeCommit message (Collapse)Author
2013-03-27* time.c (num_exact): use to_r method only if to_int method isakr
available. [ruby-core:53764] [Bug #8173] reported by Hiro Asari. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-15time.c: check re-initializenobu
* time.c (GetTimeval): check if already initialized instance. * time.c (GetNewTimeval): check if newly created instance. * time.c (time_init_0, time_init_1, time_init_copy, time_mload): must be newly created instance. [ruby-core:53436] [Bug #8099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07Use more portable value for ENV['TZ']naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07* time.c (time_mdump): dump timezone string to private instance variablenaruse
on marshaling. * time.c (time_mload): load timezone string from private instance variable named 'zone'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11update tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-30utc offset in secondsnobu
* time.c (utc_offset_arg): utc offset can be precision in seconds. e.g. old Europe/Lisbon (c.f. [ruby-dev:40066]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-29strftime.c: triple colons modifiernobu
partially borrowed from ext/date. * strftime.c (rb_strftime_with_timespec): support GNU extension triple colons modifier. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-29strftime.c: fix locale modifiernobu
partially borrowed from ext/date. * strftime.c (rb_strftime_with_timespec): check conversion with locale modifier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-29strftime.c: fix colon modifier.nobu
partially borrowed from ext/date. * strftime.c (rb_strftime_with_timespec): colons are valid only for 'z' and must come just before it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-15test/ruby/test_time.rb: split a big testnobu
* test/ruby/test_time.rb (TestTime#test_strftime): split a big test by subjects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-19* strftime.c (rb_strftime_with_timespec): fix carrir-up bug andnobu
overwrite '+' with '-' if negative offset less than a hour. [ruby-core:44447][Bug #6323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17* strftime.c (rb_strftime_with_timespec): fix padding of time zonenobu
offset. [ruby-dev:43287][Bug #4458] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24* time.c (time_init_1): Time.new will accept seconds as string ornobu
int. [ruby-core:43569][Bug #6193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-19* time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.akr
patch by Tomoyuki Chikanaga. [ruby-dev:44827] [Bug #5586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27* strftime.c (rb_strftime_with_timespec): get enc argument to specifynaruse
the encoding of the format. On Windows (at least Japanese Windows), Time#strftime("%Z") includes non ASCII in locale encoding (CP932). So convert locale to default internal. [ruby-core:39092] [Bug #5226] * strftime.c (rb_strftime): ditto. * strftime.c (rb_strftime_timespec): ditto. * internal.h (rb_strftime_timespec): follow above. * time.c (rb_strftime_alloc): ditto. * time.c (strftimev): ditto. * time.c (time_strftime): ditto. * time.c (time_to_s): the resulted string of Time#to_s is always ascii only, so this should be US-ASCII. * time.c (time_asctime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25* time.c (strftimev): Make Time#to_s default to US-ASCII encoding buttenderlove
respect Encoding.default_internal. [ruby-core:39092] * test/ruby/test_time.rb (class TestTime): Corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07* time.c (rb_strftime_alloc): raise ERANGE if width is too large.kosaki
Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285] * test/ruby/test_time.rb (class TestTime): add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17* error.c (rb_check_trusted): new function to check an object isnobu
trusted. * struct.c (rb_struct_modify), time.c (time_modify): check by the above function to show proper class names. [Bug #5036] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15* time.c (time_dup): used rb_obj_class() instead of CLASS_OF().kosaki
The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071] * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass): added a new test for eigenclass of time object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30* strftime.c (rb_strftime_with_timespec): %G produces 4 digits.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-30* vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.naruse
patched by Peter Weldon <peter.weldon AT null.net> [ruby-core:33985] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-27* time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22* time.c (time_zone): use rb_locale_str_new_cstr to set encodingnaruse
as locale and convert its content to internal encoding. [ruby-core:33278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-06add tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31* time.c (rb_big_abs_find_minbit): fix handling the last word.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31* time.c: less bignum allocations.akr
* strftime.c (rb_strftime_timespec): defined to avoid rational for nano second resolution time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27* time.c: fix previos commit.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11* time.c (time_round): new method Time#round. [ruby-dev:40595]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15* time.c (time_add): propagate fixed time offset.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03* time.c (time_mdump, time_mload): dump/load utc_offset.nobu
[ruby-dev:40063] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-22* time.c (time_mload): add submicro into vtm.subsecx. [ruby-dev:40133] akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13* time.c (time_to_r): convert to rational if internal representationakr
is not rational. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13* time.c (time_mdump): use nano_num and nano_den instead of subnano toakr
avoid Rational class in marshaled data which prevent unmarshal by Ruby 1.8. (time_mload): use nano_num and nano_den. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-25add tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-22add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-02don't use a string for Time.at argument.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-12add test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-21* time.c (time_arg): use the year argument as-is. [ruby-dev:38194]akr
* 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
2009-04-21* time.c: remove time_t restriction from Time class.akr
* timev.h: new file to define struct vtm. * strftime.c: format struct vtm instead of struct tm. * ext/syck/rubyext.c (mktime_do): don't use time_t; [ruby-dev:38191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-26* time.c (time_cmp): negate the result of reverse comparison.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23* strftime.c (rb_strftime): use locale insensitive functions for tr_TRakr
locale. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24* strftime.c (rb_strftime): The # flag should work with %a, %A, %b,shugo
%B, and %h. [ruby-dev:37162] * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24* strftime.c (rb_strftime): A width specifier for %t and %n shouldshugo
work. [ruby-dev:37160] * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24* strftime.c (rb_strftime): The precision of %0N should be 9.shugo
[ruby-dev:37156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24* strftime.c (rb_strftime): The default precision should be 1, notshugo
0. [ruby-dev:37155] * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* strftime.c (rb_strftime): supported %s and %P.shugo
* time.c (time_strftime): ditto. * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* strftime.c (rb_strftime): fixed a bug of padding.shugo
* test/ruby/test_time.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") shouldshugo
return "0", not "". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* test/ruby/test_time.rb: suppress warning during test.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e