aboutsummaryrefslogtreecommitdiffstats
path: root/time.c
Commit message (Collapse)AuthorAgeFilesLines
* * time.c (time_init_1): Time.new will accept seconds as string ornobu2012-03-241-8/+2
| | | | | | int. [ruby-core:43569][Bug #6193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* typo fix.akr2012-03-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-03-091-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu2012-02-271-4/+6
| | | | | | | rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-02-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-02-111-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-11-191-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.akr2011-11-191-1/+4
| | | | | | | | | 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
* * whitespace cleanup.nobu2011-11-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (Init_Time): Remove editorial comments from Timedrbrain2011-10-061-8/+7
| | | | | | | documentation, fix link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (Init_Time): Improve Time documentation. Patch by Shanedrbrain2011-10-061-14/+78
| | | | | | | | | Emmons. [Ruby 1.9 - Bug #5404] * lib/time.rb: Improve time.rb documentation including Time.strptime. Patch by Shane Emmons. [Ruby 1.9 - Bug #5402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-16/+16
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-09-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_strftime_timespec): moved from time.c and define onlynaruse2011-08-271-7/+0
| | | | | | | | if ruby/encoding.h is included. * internal.h (rb_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_strftime_timespec): move to time.c because it dependsnaruse2011-08-271-0/+3
| | | | | | encoding.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime_with_timespec): get enc argument to specifynaruse2011-08-271-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* * time.c (strftimev): Make Time#to_s default to US-ASCII encoding buttenderlove2011-08-251-0/+2
| | | | | | | 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
* update doc.akr2011-08-251-1/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_strftime_alloc): raise ERANGE if width is too large.kosaki2011-08-071-1/+5
| | | | | | | | | | | 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
* * error.c (rb_check_trusted): new function to check an object isnobu2011-07-171-2/+1
| | | | | | | | 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
* * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().kosaki2011-07-151-1/+1
| | | | | | | | | | | 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
* time.c: can't compile time.c on AIX due to missing declaration forkanemoto2011-07-111-0/+4
| | | | | | | | | | ffs(). It is declared in strings.h on AIX. If I need to add something like '&& defined(_AIX)', please let me know. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr2011-06-181-1/+0
| | | | | | | | | | | | | | | declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare more internal functions.akr2011-06-181-3/+0
| | | | | | | | | | | | | | * iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_time_new): prevent overflow by "* 1000".naruse2011-06-161-1/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: a correction of doc for strftime (%v).tadf2011-06-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (rb_gmtime_r2): adjust indent.nobu2011-06-071-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-151-14/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (random_rand): remove unused variables.naruse2011-04-251-3/+0
| | | | | | | | | | | | | | * struct.c (rb_struct_define_without_accessor): ditto. * strftime.c (rb_strftime_with_timespec): ditto. * sprintf.c: ditto. * time.c (time_asctime): remove useless GetTimeval(). * thread_pthread.c: cast to (void *) for %p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c: suppressed shorten-64-to-32 warnings.naruse2011-01-311-2/+2
| | | | | | | | | | | | * regcomp.c: ditto. * regexec.c: ditto. * regint.h: ditto. * regparse.c: ditto. * regparse.h: ditto. * time.c: ditto. * variable.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-01-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-01-171-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2011-01-171-35/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c: parenthesize macro arguments.akr2010-11-271-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (leap_year_v_p): fixed typo. [ruby-dev:42631]nobu2010-11-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_zone): use rb_locale_str_new_cstr to set encodingnaruse2010-11-221-2/+2
| | | | | | | 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
* * array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),nobu2010-10-131-16/+14
| | | | | | | gc.c (undefine_final), time.c (time_mload): get rid of type-punning casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-07-191-35/+35
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-1/+1
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-07-171-11/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dbm/dbm.c (struct dbmdata, fdbm_key, fdbm_delete_if): fixednobu2010-07-161-3/+1
| | | | | | | | type warnings. * time.c (calc_tm_yday): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (guess_local_offset): use the UTC offset of an older date onakr2010-07-141-2/+9
| | | | | | | 64bit time_t environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (localtime_with_gmtoff_zone): renamed fromakr2010-07-141-31/+63
| | | | | | | | | | localtime_with_gmtoff and return the timezone abbreviation name. (guess_local_offset): return the isdst and timezone abbreviation name. (localtimew): use the returned isdst and timezone abbreviation name. [ruby-core:31275] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-07-101-28/+68
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-07-091-22/+58
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (find_time_t): 24:00 should be the beginning of the nextakr2010-07-091-1/+2
| | | | | | | day even if the leap second, 23:59:60, exists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-07-081-54/+78
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* document %g and %G for Time#strftime.akr2010-07-081-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime_with_timespec): support %:z and %::z.akr2010-07-071-1/+3
| | | | | | | [ruby-dev:41841] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e