Top "Java-time" questions

The java.

DateTimeFormatter month pattern letter "L" fails

I noticed that java.time.format.DateTimeFormatter is not able to parse out as expected. See below: import java.time.…

java date java-8 java-time
JSTL LocalDateTime format

I want to format my Java 8 LocalDateTime object in "dd.MM.yyyy" pattern. Is there any library to format? I …

jsp jstl date-format java-time
Duration.ofDays generates UnsupportedTemporalTypeException

I am trying to learn the new Date & Time API. My code is working except for the last line: …

java duration java-time
Java 8 Time API - ZonedDateTime - specify default ZoneId when parsing

I am trying to write a generic method to return a ZonedDateTime given a date as String and its format. …

java timezone java-time datetime-parsing zoneddatetime
Java 8 DateTimeFormatter parsing for optional fractional seconds of varying significance

My MCVE (as a TestNG unit test): public class MyDateTimeFormatterTest { private static final String BASE_PATTERN = "yyyy/MM/dd HH:…

java java-time datetime-parsing
Is java.time failing to parse fraction-of-second?

With the first release of Java 8 (b132) on Mac OS X (Mavericks), this code using the new java.time package …

java java-time
`uuuu` versus `yyyy` in `DateTimeFormatter` formatting pattern codes in Java?

The DateTimeFormatter class documentation says about its formatting codes for the year: u year year 2004; 04 y year-of-era year 2004; 04 … Year: The …

date parsing datetime date-formatting java-time
Java8- ZonedDateTime with DateTimeFormatter not recognizing the format

I am using the ZonedDateTime with DateTimeFormatter of Java 8. When I try to parse my own pattern it doesn't recognizes …

java-8 java-time zoneddatetime
Is it possible to truncate date to Month with Java 8?

I want to get the milliseconds truncated to days, I can use Instant.now().truncatedTo(ChronoUnit.DAYS).toEpochMilli() But I …

java java-8 truncate java-time
Jackson , java.time , ISO 8601 , serialize without milliseconds

I'm using Jackson 2.8 and need to communicate with an API that doesn't allow milliseconds within ISO 8601 timestamps. The expected format …

java jackson java-time jackson-modules jackson2