"America/Los_Angeles"(PST)で、今夜から深夜までのミリ秒数を取得する必要があります。PSTでmillisをmidnigthにする方法
midnightAtPST = ???;
long millis = ChronoUnit.MILLIS.between(now, midnightAtPST) ???
これは間違った値与える、私は今のところ持っているものである:ないLocalDateTime
を、使用しないでください、あなたは特定のゾーン内の時間のために興味を持っているので
LocalDateTime midnight = LocalDateTime.now().toLocalDate().atStartOfDay().plusDays(1);
Instant midnigthPST = midnight.atZone(ZoneId.of("America/Los_Angeles")).toInstant();
Instant now = LocalDateTime.now().toInstant(ZoneOffset.UTC);
long millis = ChronoUnit.MILLIS.between(now, midnigthPST);
問題は何ですか? –