Skip to content

Instantly share code, notes, and snippets.

@hjonck
hjonck / main.java
Last active October 5, 2017 15:22
Play with Java 8 Dates, new time API and catching invalid dates, getting the first Sunday in each Month
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.sql.*;
import java.time.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Main {
public static Date isValidDate(String inDate, String formatString) {