| 610 | } |
| 611 | |
| 612 | Int32 Timezone::localOffsetUsingRules(const Date& date,UInt32 clock,bool& isDST) { |
| 613 | if (!_StartDST) |
| 614 | return _offset; // no daylight |
| 615 | |
| 616 | // no transitions, use default rule |
| 617 | if (date.month() < _StartDST.month || (_EndDST && date.month() > _EndDST.month)) |
| 618 | return _offset; // no daylight |
| 619 | |
| 620 | if (date.month() == _StartDST.month) |
| 621 | isDST = !isBeforeTransition(date,clock, _StartDST); |
| 622 | else if (_EndDST && date.month() == _EndDST.month) |
| 623 | isDST = isBeforeTransition(date, clock, _EndDST); |
| 624 | else |
| 625 | isDST = true; |
| 626 | return isDST ? _dstOffset : _offset; |
| 627 | } |
| 628 | |
| 629 | bool Timezone::isBeforeTransition(const Date& date,UInt32 clock,const TransitionRule& rule) { |
| 630 | // Consider that we are on the same month, and rule!=NIL! (caller checking) |
no test coverage detected