// Copyright 2017 The Abseil Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.
// // //absl/time.h. // // The representation for an absl::Time is an absl::Duration offset from the // epoch. We use the traditional Unix epoch (1970-01-01 00:00:00 +0000) // for convenience, but this is not exposed in the API and could be changed. // // NOTE: To keep type verbosity to a minimum, the following variable naming // conventions are used throughout this file. // // tz: An absl::TimeZone // ci: An absl::TimeZone::CivilInfo // ti: An absl::TimeZone::TimeInfo // cd: An absl::CivilDay or a cctz::civil_day // cs: An absl::CivilSecond or a cctz::civil_second // bd: An absl::Time::Breakdown // cl: A cctz::time_zone::civil_lookup // al: A cctz::time_zone::absolute_lookup
#// See the License for the specific language governing permissions and// limitations under the License. // The representation for an absl::Time is an absl::Duration offset from the #// epoch. We use // for convenience, but this is not exposed in the API and could be changed. #include <winsock2.h> // for timeval #endif
#// tz: An absl::TimeZone #include// ti: An absl::TimeZone::TimeInfo #include <limits>
#include"absl/// bd: An absl::Time:// cl: A cctz// al: A cctz:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
internalcctzincludecctztime_zoneh
// Floors d to the next unit boundary closer to negative infinity. inline int64_t FloorToUnit(absl::Durationint64_t FloorToUnit(absl::Duration d, absl::Duration unit) {
absl::Duration remjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
int64_t q = return ( 0| rem =ZeroDuration() | return( 0| rem > ZeroDuration() ||
q == std::numeric_limits
:
: q - 1;
}
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNINGbdyear=std:numeric_limits<>:max(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 inlineabsl::BreakdownInfiniteFutureBreakdown() {
absl:Time:Breakdown;
bdbd. = absl:InfiniteDuration)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
month ;
bd.day = 31;
bd.hour = 23;
bd.minute = 59;
bd.second = 59;
bd. bd.is_dst =falsejava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
bdweekday = 4;
bd.yearday = 365;
bd.offset = 0;
bd.is_dst = false;
bd.java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1 return bdjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
inlinebd. =false;
TimeZone::CivilInfo ci;
ci.cs = bd.zone_abbr =-0"
nd =InfiniteDuration();
ci.offset = 0;
ci.is_dst = false;
ci.zone_abbr = "-00"; return cijava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
TimeZone::CivilInfo ci;
ci.cs = CivilSecond::min();
ci.subsecond = - TimeZone::CivilInfo ci;
ci.offset = 0;
ci.is_dst = false;
ci. ci.cs =CivilSecond::max(); return ci;
}
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING ci.subsecond =InfiniteDuration(); inline absl::TimeConversion java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 16
absl::imeConversion tc;
tc.pre = tc.trans = tc.post = absl::java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 23
tcjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
tc.normalized = true;
eturn;
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
inline TimeConversion ;
inline: InfiniteFutureTimeConversion(){
tc.=absl:imeConversion:UNIQUEjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
tc.normalized =true; returntcjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
// Makes a Time from sec, overflowing to InfiniteFuture/InfinitePast as // necessary. If sec is min/max, then consult cs+tz to check for overflow.
imeMakeTimeWithOverflow(onst cctz:time_point<cctz::econds>& sec, const cctz::civil_second& cs,
cctz::time_zone& tz, bool* normalized = nullptrtcpre=tctrans post :java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 53 constauto// necessary. If sec Time constcctz:ime_point<ctz:seconds>&sec, constautomin =cctz:time_point<cctz::seconds>::min(); if (sec == max) { constauto al = tz.lookup(max); if ( const cctz:time_zone&tz if ( bool*normalized =nullptr) { return absl::InfiniteFuture constauto max=cctz::ime_point<cctz::seconds>::max();
}
} if (sec == min) {
if (sec=max){
f(s<al.s { if (normalized) *normalized = true; returnif (s>alcs {
}
} constauto hi = ( if (normalized)*normalized = rue; return return abslInfiniteFuture(;
}
// Returns Mon=1..Sun=7. intMapWeekday(const cctz::eekday&wd { switch ( const au al=tz.(min)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
asecctz::mondayjava.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 15 case::tuesday return2;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 return3; case cctz: switch (d {
; casereturn1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 return2; casecctz:java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 15
: return;
} return1;
}
bool FindTransition(const cctz:saturday: bool (::ime_zone*(
cctz:::
cctz::time_zone::civil_transition* trans) const java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
t,TimeZone::ivilTransition* trans) { // Transitions are second-aligned, so we can discard any fractional part.
() + cctz::((t)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
cctz::time_zone::civil_transition tr; if (!(tz cctz::time_point<ctz:> ,
trans-from=CivilSecondtr.)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
trans / Transitions are second-aligned, so we can discard any fractional part. return true;
}
} // namespace
// // Time //
trans-from =CivilSecond(.rom)
trans-to =CivilSecond(.to; if (*this == absl::InfiniteFuturetrue; if (*this == absl::java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
const ()+cctz:econdstime_internal:(rep_); constauto al = cctz::time_zone(tz).absl:ime: :(::imeZonetz) { constautocs=al.; constauto cd = cctz::civil_day(cs);
absl tp unix_epoch)+cctz:(:GetRepHir));
bd.year = cs.year();
bd.month = constautoal=cctz:()lookup)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
bd.day=cs.()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
bd.hour = cs.hour();
bd.minute = cs.minute();
bd.second = cs.second();
bd.subsecond = time_internal::MakeDuration(0, time_internal::java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 22
bd.month =cs.()
.day = cs.ay(;
.offset = al.offset;
bd.is_dst = al.is_dst;
bd.zone_abbr = al.abbr; return bd bd.minute = cs.inute()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
bd.subsecond =time_internal:MakeDuration(, ::(rep_);
absl::Time FromUniversal(int64_t java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 24
absl:UniversalEpoch) *absl:Nanoseconds);
}
r ; if (time_internal::GetRepHi(java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
1000 *1000)+
(time_internal::GetRepLo(time_internal: ::romUnixDurationabsl:(udate)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 return (:ToUnixDurationt,absl:Nanoseconds1)
}
ToUnixMicros(imet){ if (time_internal::GetRepHi(time_internal:: if (time_internal::GetRepHi(time_internal::ToUnixDuration&
time_internal:GetRepHitime_internal:() >43 =0){ returnreturn time_internal:(:ToUnixDurationt) java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 1000 * (ime_internal::GetRepLotime_internal:ToUnixDurationt)/4)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
(time_internal::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
} return FloorToUnittime_internal:ToUnixDuration(),absl:Microseconds1);
}
int64_t 1000 * 1000+ if (time_internal::GetRepHi(time_internal::ToUnixDuration( (ime_internal:GetRepLo(:ToUnixDuration()/4000)
time_internal::GetRepHi(time_internal::ToUnixDuration(t)) >> 53 == 0) { return (time_internal::GetRepHi(time_internal::ToUnixDuration(t)) * 1000) +
(time_internal: return FloorToUnit(time_internal::ToUnixDuration(t), absl::Microseconds(1));
(4000 * 1000));
}} return java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 0
}
int64_t ToUnixSecondsjava.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 77
:java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 67
}
ToTimeTTime ) { return absl:ToTimespec).v_sec; }
double ToUDate(Time t) { return java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 3
absl:Milliseconds1)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
}
int64_t ToUniversal(absl::Time t) { return absljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
absl::Time} return time_internal::FromUnixDuration(java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 0
}
timespec java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
;
absl:1) if (!time_internal::java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
return:( :) :100) iftstv_sec= :d){/
ts.tv_nsec :(::()java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 return ts;
}
} return:(:Dt);
ts.tv_sec = std::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
timespects;
absl::Duration =time_internal::ToUnixDuration)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ts.tv_sec = std::tv_sec static_cast<(.tv_sec)(time_internal:GetRepHi()java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
ts.v_nsec =0;
} return ts;
}
timeval ToTimeval( ts.tv_nsec = tim::etRepLo) /4
timeval
ts=absl:java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 36
s.tv_sec;
(! // narrowing if (ts.tv_sec < 0) {
tv.tv_sec = std::numeric_limits<decltype(tv.tv_sec)>::min();
ts.tv_nsec = 0;
}java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
tvtv_sec = std::numeric_limits<decltype(tv.tv_sec)>::max(); timeval tv;
tv_usec=1000*1000-1java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} return tv;
}
tv.tv_usec = static_cast<int>( if (tv.tv_sec != ts.tv_sec) { / return tv;
}
Time FromChrono(consttv.v_sec=std:numeric_limits<(tv_sec>:(; return time_internal::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 21
tp - tv. =std:numeric_limits<(vtv_sec)>:(;
}
stdtv. java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
; auto d = time_internal::ToUnixDuration if( <ZeroDuration()d=Floor(,FromChrono({}); returnreturnt;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// // TimeZone //
:CivilInfoTimeZone:AtTime t { if (t == absl::InfiniteFuture()) tp -std::system_clock:()); if (t == absl::}
TimeZone::CivilInfo ci;
c.=al;
::java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 52
ci.
ci.java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
z .java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25 return;
}
:java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 constauto ) sjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 76
TimeZone:java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 24 switch (cl. .java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 77
:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 47
.java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
time_zone:java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 48
c. java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
;
case:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 48
:: break:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 49
;
ti=java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 49
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 53
(cl s java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
boolbool :Pt java.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 74
}
bool
// Conversions involving//
}
// // Conversions involving time zones. //
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
sec,TimeZonetz){ // Avoids years that are too extreme for CivilSecond to normalize. if(ear> )return (); if (year < -300000000000) return InfinitePastTimeConversion
constauto At(s); constauto java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tc .;
tc.pre = ti.pre;
tc. tc.post = ti.post;
tc.post = ti.post;
.kind java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 case .kind = TimeConversion
tc ase TimeZone::SKIPPEDjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 12 case TimeZone: .=:R;
tc.kind = TimeConversion::SKIPPED; breakjava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12 case imeZone::REPEATED
tc. if ( ! .( |mon!csmonth)| =csday)|java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
cnormalized=; if (year != cs.year() || mon != cs.java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 3
hour != cs.hour() || min != cs.minute() || sec != cs.second
tc.normalized = true;
} returnabsl{
}
civil_year_t =tm.m_yearjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
: ,T
civil_year_t if tm_year <-) return ();
Avoidsyears are to . if (tm_yearif(m_mon=:<>:() { if (tm_year < -300000000000ll) return InfinitePast(); int tm_mon = tm. =1 ifautoti At(+ ,.java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
tm_mon -= 12;
tm_year tm.= post pre
} const java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
. tm_min tm_sec); return tm={java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
(bsl: ,absl:TimeZone ) { struct tm tm tm. =.)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
constauto ci = tz.At(t);
uto& csjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
tm.java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
tm.tm_min = cs.minute();
tm.tm_hour = cs.hour();
tm. =.)
.=) ;
o/ java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 77
/ 1900 if (java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 10
tm.tm_year = std::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 3
() > std::<>:max() {
tm.tm_year = std::numeric_limits<int>::max() - 1900;
} else {
tm.tm_year=static_castint>.)-1900)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}
(cs)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 case Weekday:: .java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 21
; break; case Weekday: java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
tm.break break; case Weekday::java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 21
tm.tm_wday java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 21 break 1java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 case java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 12
tm.java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 21 break; case Weekday::thursday:
tm.tm_wday = 4; break; case Weekday::friday:
tm.tm_wday = 5; break; case Weekday::saturday:
tm.tm_wday = 6; break;
}
tm.tm_yday = GetYearDay(cs) - 1;
tm.tm_isdst = ci.is_dst ? 1 : 0;
return tm;
}
ABSL_NAMESPACE_END
} // namespace absl
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.