Skip to content

Instantly share code, notes, and snippets.

@karl82
Created June 16, 2020 18:08
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 karl82/17c747a20bf60343d658f77740b4a462 to your computer and use it in GitHub Desktop.
Save karl82/17c747a20bf60343d658f77740b4a462 to your computer and use it in GitHub Desktop.
Instant.parse difference between JDK11 and JDK13+
import java.time.Instant;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
public class InstantParseTest {
@ParameterizedTest
@ValueSource(strings = {"2019-12-20T00:00:00+00:00", "2019-12-19T16:00:00-08:00", "2019-12-20T00:00:00Z"})
public void parse(String text) {
System.out.println(Instant.parse(text));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment