* time.c (time_s_now): added in: option to Time.now as well as
Time.at.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (vtm_add_offset): separate sign argument to get rid of
repeated negations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (vtm_add_offset): just add offset to other components
only. removed subtraction of utc_offset as it is overwritten
always immediately in callers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (time_set_utc_offset): reset zone when setting to fixoff
mode. while previously TZMODE_SET_FIXOFF has reset it always,
the zone is kept for loaded zone since r65025.
[ruby-core:90627] [Bug #15439]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (time_timespec): range check is only for time interval
value if time_t is signed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (time_timespec): Time interval value can be zero, not
only positive. [ruby-dev:50709] [Bug #15420]
From: shuujii (Shuji KOBAYASHI) <shuujii@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c: [DOC] fix typos, drop unnecessary `p' from code examples,
add missing `#' for return values, other small improvements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Especially over checking argc then calling rb_scan_args just to
raise an ArgumentError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Especially over the year 2038, 30 Feb and so on may cause odd behavior
on validating found epoch with given year-month-day [Bug #15340]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (tm_initialize): allow 7th argument as well as
Time#initialize, but just ignore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (time_localtime): check if `vtm.zone` is a simple zone
name string before trying to call the conversion method. since
r64952, `Time.getlocal` on UTC time has lost the performance
about 45%, due to this call. the performance is about 90% of
r64951 by avoiding it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (tm_initialize): arguments other than year are optional
now as Time.new.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The former states explicitly that the argument must be a literal,
and can optimize away `strlen` on all compilers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (zone_str): while rb_fstring_usascii and the family
require that the argument string is never modified, tzname may
point areas which will be discarded by calling tzset().
make a String then call rb_fstring to copy the zone name.
when an ID equals TZ environment variable, its name string also
has modified by changing tzname.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (time_utc_or_local): split into time_s_mkutc and
time_s_mktime without utc flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e