Lines Matching +full:apr +full:- +full:v2
1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
68 //===----------------------------------------------------------------------===//
70 //===----------------------------------------------------------------------===//
78 // - The expected result returns the "best" sys_info object. This object can be
83 // - The unexpected result means no sys_info object was found and the time is
103 // Format based on https://data.iana.org/time-zones/tz-how-to.html
106 // are either ASCII alphanumerics, "+", or "-"
137 __result += '-'; in __format()
138 __offset = chrono::hh_mm_ss{-(__continuation.__stdoff + __save)}; in __format()
162 } else if (__c == '+' || __c == '-' || std::isalnum(__c)) { in __format()
167 …"corrupt tzdb FORMAT field: invalid character '{}' found, expected +, -, or an alphanumeric value"… in __format()
189 return __continuation.__at.__time - __continuation.__stdoff - in __at_to_sys_seconds()
202 … static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support in __at_to_sys_seconds()
212 return __continuation.__at.__time - __continuation.__stdoff; in __at_to_sys_seconds()
228 … static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support in __to_year_month_day()
269 …sys_seconds operator()(seconds __save) const noexcept { return __until_ - __needs_adjustment_ * __… in operator ()()
284 return __rule.__at.__time - __stdoff; in __at_to_seconds()
290 return __rule.__at.__time - __stdoff; in __at_to_seconds()
312 return __result->second; in __get_rules()
317 // Per https://data.iana.org/time-zones/tz-how-to.html
348 // 9 - JST 1945 N 18 2 // (1)
350 // R HK 1946 o - Ap 21 0 1 S // (3)
381 if (__rule->__save.__time != 0s) in __get_sys_info_before_first_rule()
385 …__begin, __next_end, __continuation.__stdoff, 0min, chrono::__format(__continuation, __rule->__let… in __get_sys_info_before_first_rule()
391 return __rule.__at.__time - __stdoff - __save; in __at_to_seconds()
397 return __rule.__at.__time - __stdoff; in __at_to_seconds()
418 // R So 1945 o - May 24 2 2 M
419 // R So 1945 o - S 24 3 1 S
420 // R So 1945 o - N 18 2s 0 -
438 for (year __y = __it->__from; __y <= __it->__to; ++__y) { in __next_rule()
465 // R HK 1973 o - D 30 3:30 1 S (R1) in __next_rule()
466 // R HK 1965 1976 - Ap Su>=16 3:30 1 S (R2) in __next_rule()
468 // 1973-12-29 19:30:00 R1 becomes active. in __next_rule()
469 // 1974-04-20 18:30:00 R2 becomes active. in __next_rule()
472 …if (__current->__save.__time != __it->second->__save.__time || __current->__letters != __it->secon… in __next_rule()
484 // R Sa 2008 2009 - Mar Su>=8 0 0 -
485 // R Sa 2007 2008 - O Su>=8 0 1 -
513 …auto __next = chrono::__next_rule(__rule_begin, __continuation.__stdoff, __rule->__save.__time, __… in __get_sys_info_rule()
517 // -4:42:46 - SMT 1927 S in __get_sys_info_rule()
518 // -5 x -05/-04 1932 S in __get_sys_info_rule()
521 // R x 1927 1931 - S 1 0 1 - in __get_sys_info_rule()
522 // R x 1928 1932 - Ap 1 0 0 - in __get_sys_info_rule()
524 …rica/Punta_Arenas Thu Sep 1 04:42:45 1927 UT = Thu Sep 1 00:42:45 1927 -04 isdst=1 gmtoff=-14400 in __get_sys_info_rule()
525 …// America/Punta_Arenas Sun Apr 1 03:59:59 1928 UT = Sat Mar 31 23:59:59 1928 -04 isdst=1 gmtoff… in __get_sys_info_rule()
526 …// America/Punta_Arenas Sun Apr 1 04:00:00 1928 UT = Sat Mar 31 23:00:00 1928 -05 isdst=0 gmtoff… in __get_sys_info_rule()
529 // [1927-09-01 04:42:45, 1927-09-01 05:00:00) -05:00:00 0min -05 in __get_sys_info_rule()
531 …if (sys_seconds __begin = __rule->__save.__time != 0s ? __rule_begin : __next.first; __time < __be… in __get_sys_info_rule()
532 if (__continuation_begin == sys_seconds::min() || __begin - __continuation_begin > 12h) in __get_sys_info_rule()
541 // R c 1944 1945 - Ap M>=1 2s 1 S (R1) in __get_sys_info_rule()
543 // R So 1945 o - May 24 2 2 M (R2) in __get_sys_info_rule()
547 seconds __save = __rule->__save.__time; in __get_sys_info_rule()
556 chrono::__format(__continuation, __rule->__letters, __save)}, in __get_sys_info_rule()
561 if (__rule->__save.__time == 0s && __time < __next.first) { in __get_sys_info_rule()
567 chrono::__format(__continuation, __rule->__letters, 0s)}, in __get_sys_info_rule()
571 if (__rule->__save.__time != 0s) { in __get_sys_info_rule()
574 seconds __save = __rule->__save.__time; in __get_sys_info_rule()
575 if (__continuation_begin >= __rule_begin - __save && __time < __next.first) { in __get_sys_info_rule()
581 chrono::__format(__continuation, __rule->__letters, __save)}, in __get_sys_info_rule()
596 __rule->__save.__time, in __get_sys_info_rule()
597 __next.first - __rule_begin); in __get_sys_info_rule()
600 sys_seconds __end = __continuation_end(__rule->__save.__time); in __get_sys_info_rule()
604 seconds __diff = chrono::abs(__sys_info_end - __sys_info_begin); in __get_sys_info_rule()
607 // Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31 in __get_sys_info_rule()
608 // -4:16:48 - CMT 1920 May in __get_sys_info_rule()
609 // -4 - -04 1930 D in __get_sys_info_rule()
610 // -4 A -04/-03 1969 O 5 in __get_sys_info_rule()
611 // -3 A -03/-02 1999 O 3 in __get_sys_info_rule()
612 // -4 A -04/-03 2000 Mar 3 in __get_sys_info_rule()
616 // R A 1989 1992 - O Su>=15 0 1 - in __get_sys_info_rule()
617 // R A 1999 o - O Su>=1 0 1 - in __get_sys_info_rule()
618 // R A 2000 o - Mar 3 0 0 - in __get_sys_info_rule()
619 // R A 2007 o - D 30 0 1 - in __get_sys_info_rule()
623 // R A 1999 o - O Su>=1 0 1 - in __get_sys_info_rule()
624 // stdoff -3 -> 1999-10-03 03:00:00 in __get_sys_info_rule()
625 // stdoff -4 -> 1999-10-03 04:00:00 in __get_sys_info_rule()
631 …__next = __next_rule(__next.first, __continuation.__stdoff, __rule->__save.__time, __rules… in __get_sys_info_rule()
632 __end = __continuation_end(__rule->__save.__time); in __get_sys_info_rule()
643 __continuation.__stdoff + __rule->__save.__time, in __get_sys_info_rule()
644 chrono::duration_cast<minutes>(__rule->__save.__time), in __get_sys_info_rule()
645 chrono::__format(__continuation, __rule->__letters, __rule->__save.__time)}, in __get_sys_info_rule()
651 …__next = __next_rule(__rule_begin, __continuation.__stdoff, __rule->__save.__time, __rules, … in __get_sys_info_rule()
656 __continuation_end(__rule->__save.__time), in __get_sys_info_rule()
657 __continuation.__stdoff + __rule->__save.__time, in __get_sys_info_rule()
658 chrono::duration_cast<minutes>(__rule->__save.__time), in __get_sys_info_rule()
659 chrono::__format(__continuation, __rule->__letters, __rule->__save.__time)}, in __get_sys_info_rule()
691 … static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support in __get_sys_info()
725 //===----------------------------------------------------------------------===//
727 //===----------------------------------------------------------------------===//
738 …BCPP_EXPORTED_FROM_ABI string_view time_zone::__name() const noexcept { return __impl_->__name(); } in __name()
754 // [zic manual](https://www.man7.org/linux/man-pages/man8/zic.8.html) in __get_info()
755 // [tz source info](https://data.iana.org/time-zones/tz-how-to.html) in __get_info()
757 // zdump -v Asia/Hong_Kong in __get_info()
769 // 0 - WET 1967 (C2) in __get_info()
773 // R s 1926 1929 - O Sa>=1 24s 0 - (R1) in __get_info()
775 // R Sp 1967 o - Jun 3 12 1 S (R2) in __get_info()
782 // 1928-10-07 00:00:00 C1 R1 becomes active: offset 0 save 0 abbrev WET in __get_info()
783 // 1929-01-01 00:00:00 C2 becomes active: offset 0 save 0 abbrev WET in __get_info()
784 // 1967-01-01 00:00:00 C3 becomes active: offset 0 save 0 abbrev WET in __get_info()
785 // 1967-06-03 12:00:00 C3 R2 becomes active: offset 0 save 1 abbrev WEST in __get_info()
788 // means the period [1928-10-07 00:00:00, 1967-06-03 12:00:00) should be in __get_info()
791 const auto& __continuations = __impl_->__continuations(); in __get_info()
792 const __tz::__rules_storage_type& __rules_db = __impl_->__rules_db(); in __get_info()
799 __sys_info->__info.begin < __sys_info->__info.end, "invalid sys_info range"); in __get_info()
802 // Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31 in __get_info()
804 // -4 A -04/-03 2000 Mar 3 (C1) in __get_info()
805 // -3 A -03/-02 (C2) in __get_info()
808 // R A 2000 o - Mar 3 0 0 - in __get_info()
809 // R A 2007 o - D 30 0 1 - in __get_info()
813 // [2000-03-03 03:00:00, 2000-03-03 04:00:00) -10800s 60min -03 in __get_info()
817 // "[2000-03-03 03:00:00, 2007-12-30 03:00:00) -02:00:00 60min -02 in __get_info()
819 if (std::holds_alternative<string>(__continuation.__rules) && __sys_info->__can_merge && in __get_info()
820 __sys_info->__info.begin + 12h > __sys_info->__info.end) { in __get_info()
821 __continuation_begin = __sys_info->__info.begin; in __get_info()
827 __result = __sys_info->__info; in __get_info()
829 __valid_result = __time >= __result->begin && __time < __result->end; in __get_info()
830 __can_merge = __sys_info->__can_merge; in __get_info()
831 } else if (__can_merge && chrono::__merge_continuation(*__result, __sys_info->__info)) { in __get_info()
835 __valid_result = __time >= __result->begin && __time < __result->end; in __get_info()
836 __can_merge = __sys_info->__can_merge; in __get_info()
841 // -3 A -03/-02 2008 Ja 21 (C1) in __get_info()
842 // -4 Sa -04/-03 2009 O 11 (C2) in __get_info()
844 // R A 2007 o - D 30 0 1 - (R1) in __get_info()
846 // R Sa 2007 2008 - O Su>=8 0 1 - (R2) in __get_info()
848 // Based on C1 & R1 the end time of C1 is 2008-01-21 03:00:00 in __get_info()
849 // Based on C2 & R2 the end time of C1 is 2008-01-21 02:00:00 in __get_info()
851 // However the algorithm used gives 2008-01-21 03:00:00. in __get_info()
857 // - When we have a valid result that result is the final result. in __get_info()
858 // - Otherwise the result we had is before __time and the result we got in __get_info()
866 const auto& __last = *(__it - 1); in __get_info()
872 // R c 1944 1945 - Ap M>=1 2s 1 S (R1) in __get_info()
874 // R So 1945 o - May 24 2 2 M (R2) in __get_info()
880 if (__result->end != __sys_info->__info.begin) { in __get_info()
883 sys_seconds __end = __result->end - __result->offset; in __get_info()
884 sys_seconds __begin = __sys_info->__info.begin - __sys_info->__info.offset; in __get_info()
886 __sys_info->__info.begin = __result->end; in __get_info()
891 __result = __sys_info->__info; in __get_info()
892 __valid_result = __time >= __result->begin && __time < __result->end; in __get_info()
893 __can_merge = __sys_info->__can_merge; in __get_info()
896 __continuation_begin = __result->end; in __get_info()
926 // |--------| in __get_info()
927 // |------| in __get_info()
931 // |--------| in __get_info()
932 // |------| in __get_info()
938 // |--------| in __get_info()
939 // |------| in __get_info()
943 // |--------| in __get_info()
944 // |------| in __get_info()
966 * |------------//----------| in __get_info()
967 * |---------//--------------| in __get_info()
968 * |------------- in __get_info()
989 if (__local_seconds - chrono::local_seconds::min().time_since_epoch() < __info.offset) in __get_info()
990 return {-1, __info, {}}; in __get_info()
993 if (chrono::local_seconds::max().time_since_epoch() - __local_seconds < -__info.offset) in __get_info()
994 return {-2, __info, {}}; in __get_info()
1000 // |---------//--------------| in __get_info()
1004 // The result is either non-existent or unique in the previous sys_info. in __get_info()
1006 // - If the sys_info begin is not sys_seconds::min(), then it might be at in __get_info()
1008 // - If sys_info end is not sys_seconds::max(), then it might be at 2.3 in __get_info()
1010 // - Else it is at 2.2 and always unique. This case happens when a in __get_info()
1013 // The result is either non-existent or unique in the next sys_info. in __get_info()
1018 // is the option of the following time-line in __get_info()
1020 // |------------| in __get_info()
1021 // |----| in __get_info()
1022 // |-----------------| in __get_info()
1027 sys_seconds __sys_time{__local_seconds - __info.offset}; in __get_info()
1030 return chrono::__get_info(__local_time, __get_info(__info.begin - 1s), __info); in __get_info()
1040 sys_info __prev = __get_info(__info.begin - 1s); in __get_info()