Java Date Time

Parse a String to UTC Date Time in Java (Z, Offset, GMT)

Learn to parse a date-time string to UTC in Java with Instant, OffsetDateTime and ZonedDateTime. Covers strings with Z, an offset, GMT or no zone at all. Also covers RFC 1123 dates, old SimpleDateFormat code and common DateTimeParseException causes.

Java DateTimeFormatter: Patterns, Parsing and Examples

Java DateTimeFormatter examples for formatting and parsing LocalDate, LocalDateTime and ZonedDateTime with ofPattern() letters, ISO constants, FormatStyle and Locale, plus DateTimeParseException handling and the yyyy vs YYYY mistake.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.