time.c: [DOC] add description and fix markups [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-10-28 12:05:17 +00:00
parent de925b4f3c
commit c4be18c28b

27
time.c
View File

@ -5285,18 +5285,25 @@ rb_time_zone_abbreviation(VALUE zone, VALUE time)
* *
* == Timezone argument * == Timezone argument
* *
* A timezone argument must have #local_to_utc, #utc_to_local, #name methods, * A timezone argument must have +local_to_utc+ and +utc_to_local+
* and may have #abbr method. * methods, and may have +name+ and +abbr+ methods.
* *
* The +#local_to_utc+ method should convert a Time-like object from the * The +local_to_utc+ method should convert a Time-like object from
* timezone to UTC, and +#utc_to_local+ is the opposite. The Time-like * the timezone to UTC, and +utc_to_local+ is the opposite. The
* argument to these methods is similar to a Time object in UTC without * result also should be a Time or Time-like object (not necessary to
* sub-second; it has attribute readers for the parts, and #to_i. The * be the same class). The #zone of the result is just ignored.
* sub-second attributes are fixed as 0, and #utc_offset, #zone, #isdst, and * Time-like argument to these methods is similar to a Time object in
* the aliases are same as a Time object in UTC. * UTC without sub-second; it has attribute readers for the parts,
* e.g. #year, #month, and so on, and epoch time readers, #to_i. The
* sub-second attributes are fixed as 0, and #utc_offset, #zone,
* #isdst, and their aliases are same as a Time object in UTC.
* Also #to_time method is defined.
* *
* The #name method is used for marshaling, and the #abbr method is used by * The +name+ method is used for marshaling. If this method is not
* '%Z' in #strftime. * defined on a timezone object, Time objects using that timezone
* object are not able to dump by Marshal.
*
* The +abbr+ method is used by '%Z' in #strftime.
*/ */
void void