This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private LocalDateTime getLocalZonedDateTime() { | |
Instant instant = Instant.now(); | |
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(ZoneId.SHORT_IDS.get("ECT"))); | |
return zonedDateTime.toLocalDateTime(); | |
} | |
private LocalDateTime getCurrentUTCDateTime() { | |
return OffsetDateTime.now(ZoneOffset.UTC).toLocalDateTime(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.stream.Stream; | |
class StreamOddNumberUnder100 { | |
public static void main(String[] args) { | |
Stream<Integer> oddNumberUnder100 = | |
Stream.iterate(1, | |
i -> i < 100, | |
i -> i+2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
import java.time.ZoneOffset; | |
import java.time.ZonedDateTime; | |
public class DateTimeConvertTest { | |
public static void main(String[] args) { |