shugo
63846d48a9
* strftime.c (rb_strftime): supported %s and %P.
...
* 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 17:06:20 +00:00
shugo
77d7a80f97
* strftime.c (rb_strftime): fixed a bug of padding.
...
* 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 15:54:44 +00:00
shugo
6a7481c38d
* strftime.c (rb_strftime): Time.mktime(2000).strftime("%-S") should
...
return "0", not "".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 15:01:07 +00:00
mame
5ef4c56784
* test/ruby/test_time.rb: suppress warning during test.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 14:55:53 +00:00
mame
846f142a17
* test/ruby/test_time.rb (test_strftime): make test for %a independent
...
from local timezone. [ruby-dev:35992]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 14:51:30 +00:00
nobu
ce2b7d3a58
* strftime.c (rb_strftime): supported flags and precision for most
...
conversions. [ruby-dev:35906]
* lib/date/format.rb (Date#strftime): left-justifies %L and %N.
[ruby-dev:35909]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 05:28:08 +00:00
shugo
a0cc5b19b7
* strftime.c (rb_strftime): supported %F and %<precision>N.
...
reverted config.h to ruby.h for Windows.
* test/ruby/test_time.rb (TestTime::test_strftime): added tests
for %F and %N.
* time.c: documented %F and %N.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 14:57:35 +00:00
shugo
9b4d4a8a48
* strftime.c (rb_strftime): return "UTC" instead of "GMT".
...
* test/ruby/test_time.rb (test_strftime): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 00:30:28 +00:00
shugo
1fd1e0ac04
* strftime.c: new file.
...
* common.mk (COMMONOBJS): added strftime.$(OBJEXT).
* time.c (time_strftime): do not use strftime(3). supported
%L(millisecond) and %N(nanosecond).
* test/ruby/test_time.rb: added tests for %L and %N.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 15:30:28 +00:00
kazu
ae87557916
* test/ruby/test_time.rb (TestTime#test_time_interval): add timeout
...
to avoid stopping tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-14 08:40:17 +00:00
akr
6e90749f80
* time.c: fix rounding negative float.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-27 16:10:46 +00:00
akr
04752225a7
* time.c (obj2nsec): fix string argument.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-04 07:05:26 +00:00
naruse
2f866a3666
* test/ruby/test_time.rb (test_readers): fix typo.
...
(test_strftime): "UTC" is also ok for time.gmtime.strftime("%Z").
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28 18:32:17 +00:00
mame
65753a5838
* test/ruby/test_pack.rb: fix tests for 64bit CPU.
...
* test/ruby/test_bignum.rb: ditto.
* test/ruby/test_file_exhaustive.rb: ditto.
* test/ruby/test_integer.rb: ditto.
* test/ruby/test_time.rb: ditto.
* test/ruby/test_numeric.rb: ditto.
* test/ruby/test_fixnum.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-10 21:52:25 +00:00
mame
2bef7dece1
* test/ruby/test_hash.rb: follow the change of Hash#flatten.
...
* test/ruby/test_time.rb: add tests to achieve over 70% test coverage
of time.c.
* test/ruby/test_prec.rb: ditto over 90% for prec.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-07 15:09:12 +00:00
akr
a070c4fbe3
* configure.in: check struct timespec, clock_gettime, utimensat,
...
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 09:09:38 +00:00
akr
3184ac2dfe
* time.c (time_minus): fix Time.at(2**60+1) - Time.at(2**60).
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-18 09:30:17 +00:00
akr
68543f3092
use ML ref. for assertion message.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-18 07:18:56 +00:00
akr
500cd0d57d
add an assertion.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-25 22:59:01 +00:00
akr
b3009ced33
add 2 assertions.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 11:08:16 +00:00
akr
5c9d45e6e7
add a test. [ruby-dev:22619]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 10:40:22 +00:00
akr
dd889fac19
more tests for Time.utc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 02:35:34 +00:00
akr
a66ee49d2c
add test for minimum 32bit signed time_t for Time.utc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-30 11:53:00 +00:00
akr
7bb7e17675
* time.c (search_time_t): limit guess range by mktime if it is
...
availabe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-30 11:31:44 +00:00
akira
8ccba1d12f
* test/ruby/test_time.rb: added tests for [ruby-dev:22614] and
...
[ruby-dev:22617].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-19 07:32:47 +00:00
siena
4e880080a7
* test/ruby/test_time.rb: new test case to test Time#[+-].
...
* time.c (time_plus, time_minus): fix RangeError for a negative
argument in environments whose time_t is unsigned. [ruby-dev:22608]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-18 04:00:00 +00:00