| 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> |