Bug #15988 ยป time-zone-dst.patch
time.c | ||
---|---|---|
4647 | 4647 | |
4648 | 4648 |
GetTimeval(time, tobj); |
4649 | 4649 |
MAKE_TM(time, tobj); |
4650 |
if ((RB_BUILTIN_TYPE(tobj->vtm.zone) != RUBY_T_STRING) && |
|
4651 |
rb_respond_to(tobj->vtm.zone, rb_intern("dst?"))) { |
|
4652 |
return RTEST(rb_funcall(tobj->vtm.zone, rb_intern("dst?"), 1, time)) ? Qtrue : Qfalse; |
|
4653 |
} |
|
4650 | 4654 |
if (tobj->vtm.isdst == VTM_ISDST_INITVAL) { |
4651 | 4655 |
rb_raise(rb_eRuntimeError, "isdst is not set yet"); |
4652 | 4656 |
} |
... | ... | |
5684 | 5688 |
* == Timezone argument |
5685 | 5689 |
* |
5686 | 5690 |
* A timezone argument must have +local_to_utc+ and +utc_to_local+ |
5687 |
* methods, and may have +name+ and +abbr+ methods.
|
|
5691 |
* methods, and may have +name+, +abbr+, and +dst?+ methods.
|
|
5688 | 5692 |
* |
5689 | 5693 |
* The +local_to_utc+ method should convert a Time-like object from |
5690 | 5694 |
* the timezone to UTC, and +utc_to_local+ is the opposite. The |
... | ... | |
5703 | 5707 |
* |
5704 | 5708 |
* The +abbr+ method is used by '%Z' in #strftime. |
5705 | 5709 |
* |
5710 |
* The +dst?+ method is called with a +Time+ value and should return whether |
|
5711 |
* the +Time+ value is in daylight savings time in the zone. |
|
5712 |
* |
|
5706 | 5713 |
* === Auto conversion to Timezone |
5707 | 5714 |
* |
5708 | 5715 |
* At loading marshaled data, a timezone name will be converted to a timezone |
5709 |
- |