Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Last active March 14, 2021 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/487c4c9025120d83613df20dba7c9698 to your computer and use it in GitHub Desktop.
Save AdamBien/487c4c9025120d83613df20dba7c9698 to your computer and use it in GitHub Desktop.
Run: java NextAirhacks.java to get the first Monday of the month
import java.time.DayOfWeek;
import java.time.LocalDate;
import static java.time.temporal.TemporalAdjusters.*;

public class NextAirhacksTV {

    public static void main(String[] args) {
        var now = LocalDate.now().plusMonths(1);
        var nextMondayOfTheMonth = now.
                with(firstDayOfMonth()).
                with(next(DayOfWeek.MONDAY));
        System.out.printf("See you at next airhacks.tv: %s 8pm CET (UTC +1)",nextMondayOfTheMonth);
    }
}

run with: java NextAirhacksTV.java to get the next airhacks.tv date. (the date may change, so very verify on airhacks.tv, adambien.blog or meetup.com/airhacks)

@arend-von-reinersdorff
Copy link

Suggestion to also find Monday the 1st:

var nextMondayOfTheMonth = now.with(firstInMonth(DayOfWeek.MONDAY));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment