MCPcopy Create free account
hub / github.com/MenoData/Time4J / in

Method in

base/src/main/java/net/time4j/PlainTimestamp.java:1104–1121  ·  view source on GitHub ↗
(Timezone tz)

Source from the content-addressed store, hash-verified

1102 * @see Timezone#of(String)
1103 */
1104 public Moment in(Timezone tz) {
1105
1106 if (tz.isFixed()) { // optimization
1107 return this.at(tz.getOffset(this.date, this.time));
1108 }
1109
1110 TransitionStrategy strategy = tz.getStrategy();
1111 long posixTime = strategy.resolve(this.date, this.time, tz);
1112 Moment moment =
1113 Moment.of(posixTime, this.time.getNanosecond(), TimeScale.POSIX);
1114
1115 if (strategy == Timezone.STRICT_MODE) {
1116 Moment.checkNegativeLS(posixTime, this);
1117 }
1118
1119 return moment;
1120
1121 }
1122
1123 /**
1124 * <p>Equivalent to {@link #inZonalView(Timezone) inZonalView(Timezone.ofSystem()}. </p>

Callers 15

inStdTimezoneMethod · 0.95
brazilRoundtripMethod · 0.95
startOfDayNormalMethod · 0.95
gap_PUSH_FORWARDMethod · 0.95
gap_NEXT_VALID_TIMEMethod · 0.95
gap_resolve_ABORTMethod · 0.95
overlap_LATER_OFFSETMethod · 0.95

Calls 8

atMethod · 0.95
resolveMethod · 0.95
ofMethod · 0.95
checkNegativeLSMethod · 0.95
getOffsetMethod · 0.65
getNanosecondMethod · 0.65
isFixedMethod · 0.45
getStrategyMethod · 0.45

Tested by 13

inStdTimezoneMethod · 0.76
brazilRoundtripMethod · 0.76
startOfDayNormalMethod · 0.76
gap_PUSH_FORWARDMethod · 0.76
gap_NEXT_VALID_TIMEMethod · 0.76
gap_resolve_ABORTMethod · 0.76
overlap_LATER_OFFSETMethod · 0.76