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

Method toGeneralTimestamp

base/src/main/java/net/time4j/Moment.java:1196–1209  ·  view source on GitHub ↗
(
        Chronology<C> chronology,
        TZID tzid,
        StartOfDay startOfDay
    )

Source from the content-addressed store, hash-verified

1194 * @since 3.8/4.5
1195 */
1196 public <C extends Calendrical<?, C>> GeneralTimestamp<C> toGeneralTimestamp(
1197 Chronology<C> chronology,
1198 TZID tzid,
1199 StartOfDay startOfDay
1200 ) {
1201
1202 PlainTimestamp tsp = this.toZonalTimestamp(tzid);
1203 PlainTime time = tsp.getWallTime();
1204 int deviation = startOfDay.getDeviation(tsp.getCalendarDate(), tzid);
1205 tsp = tsp.minus(deviation, ClockUnit.SECONDS);
1206 C date = tsp.getCalendarDate().transform(chronology.getChronoType());
1207 return GeneralTimestamp.of(date, time);
1208
1209 }
1210
1211 /**
1212 * <p>Converts this instance to a general timestamp in given timezone. </p>

Callers 15

printHijriMethod · 0.95
printMinguoMethod · 0.95
startAtMidnightMethod · 0.95
startInEveningMethod · 0.95
startAtSunsetInMeccaMethod · 0.95
nowMethod · 0.95
displayMethod · 0.95
createFromMethod · 0.80
createFromMethod · 0.80
createFromMethod · 0.80
createFromMethod · 0.80

Calls 8

toZonalTimestampMethod · 0.95
getWallTimeMethod · 0.95
getCalendarDateMethod · 0.95
minusMethod · 0.95
ofMethod · 0.95
transformMethod · 0.65
getDeviationMethod · 0.45
getChronoTypeMethod · 0.45

Tested by 6

printHijriMethod · 0.76
printMinguoMethod · 0.76
startAtMidnightMethod · 0.76
startInEveningMethod · 0.76
startAtSunsetInMeccaMethod · 0.76