Skip to content

Commit

Permalink
Use future dates
Browse files Browse the repository at this point in the history
  • Loading branch information
marchof committed May 31, 2024
1 parent 84d0a92 commit 9bbbcc6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class ConvertBetweenTimeZones {

public static void main(String... args) {
ZonedDateTime lunarEclipse = ZonedDateTime.of(LocalDate.of(2022, 11, 8), LocalTime.of(10, 59), ZoneOffset.UTC);
ZonedDateTime lunarEclipse = ZonedDateTime.of(LocalDate.of(2025, 03, 14), LocalTime.of(6, 59), ZoneOffset.UTC);
List<String> places = List.of( //
"Asia/Tokyo", "Asia/Kolkata", "Europe/Paris", "America/Fortaleza", "Pacific/Honolulu");

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/javaalmanac/snippets/time/Friday13th.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Friday13th {
public static void main(String[] args) {

YearMonth start = YearMonth.of(2000, 1);
YearMonth end = YearMonth.of(2024, 12);
YearMonth end = YearMonth.of(2030, 12);

Stream.iterate(start, m -> m.isBefore(end), m -> m.plusMonths(1)) //
.map(m -> m.atDay(13)) //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public class ConvertBetweenTimeZonesTest {
@Test
void run_main() throws Exception {
ConsoleGrabber.assertOutEquals(ConvertBetweenTimeZones::main, """
Lunar Eclipse at 2022-11-08T19:59+09:00[Asia/Tokyo]
Lunar Eclipse at 2022-11-08T16:29+05:30[Asia/Kolkata]
Lunar Eclipse at 2022-11-08T11:59+01:00[Europe/Paris]
Lunar Eclipse at 2022-11-08T07:59-03:00[America/Fortaleza]
Lunar Eclipse at 2022-11-08T00:59-10:00[Pacific/Honolulu]
Lunar Eclipse at 2025-03-14T15:59+09:00[Asia/Tokyo]
Lunar Eclipse at 2025-03-14T12:29+05:30[Asia/Kolkata]
Lunar Eclipse at 2025-03-14T07:59+01:00[Europe/Paris]
Lunar Eclipse at 2025-03-14T03:59-03:00[America/Fortaleza]
Lunar Eclipse at 2025-03-13T20:59-10:00[Pacific/Honolulu]
""");
}

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/io/javaalmanac/snippets/time/Friday13thTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ void run_main() throws Exception {
Fri 2023-01-13
Fri 2023-10-13
Fri 2024-09-13
Fri 2024-12-13
Fri 2025-06-13
Fri 2026-02-13
Fri 2026-03-13
Fri 2026-11-13
Fri 2027-08-13
Fri 2028-10-13
Fri 2029-04-13
Fri 2029-07-13
Fri 2030-09-13
""");
}

Expand Down

0 comments on commit 9bbbcc6

Please sign in to comment.