Timezone support by Time [Feature #14850]

* strftime.c (rb_strftime): support timezone object by `%z`.

* time.c (time_init_1, time_new_timew, time_getlocaltime): accept
  timezone object as `off`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-10-08 02:35:31 +00:00
parent e0bc5e49ff
commit ee58c638b8
7 changed files with 511 additions and 31 deletions

View file

@ -42,9 +42,12 @@ typedef unsigned LONG_LONG unsigned_time_t;
/* strftime.c */
#ifdef RUBY_ENCODING_H
VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
const struct vtm *vtm, struct timespec *ts, int gmt);
VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt);
VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
const struct vtm *vtm, VALUE timev, int gmt);
VALUE time, const struct vtm *vtm, VALUE timev, int gmt);
#endif
/* time.c */
VALUE rb_time_zone_abbreviation(VALUE zone, VALUE time);
#endif