Top "Java-time" questions

The java.

Java 8 java.time: Adding TemporalUnit in Instant vs LocalDateTime

I'm playing around with the new java.time package in Java 8. I have a legacy database that gives me java.…

java java-8 java-time
java.time DateTimeFormatter pattern for timezone offset

I am trying to parse: 2014-05-02-10.45.05.993280-5:00 where the -5:00 is the offset from UTC. Using a java.…

java date parsing formatter java-time
Kotlin Android / Java String DateTime Format, API21

I want convert string datetime to formatted string. e.g "2018-12-14T09:55:00" to "14.12.2018 09:55" as String => Textview.text how …

java android datetime kotlin java-time
Java SE 8 TemporalAccessor.from issues when used with a java.time.Instant object

java.time has an Instant class which encapsulates a position (or 'moment') on the timeline. While I understand that this …

java java-8 java-time
Coverting String to LocalTime with/without nanoOfSeconds

I need to convert a string to LocalTime (java-8 not joda) that may or maynot have nanoOfSeconds in the string. …

java java-8 formatter java-time localtime
UnsupportedOperationException - Why can't you call toInstant() on a java.sql.Date?

The java.util.Date class has a method called toInstant() that converts the Date instance to a java.time.Instant. …

java java-8 java-time
Java8 Adding Hours To LocalDateTime Not Working

I tried like below, but in both the cases it is showing same time? What i am doing wrong. LocalDateTime …

java-8 java-time
Formatting a Duration in Java 8 / jsr310

I am transitioning a project from Joda-Time to java8's native time libraries, and I have run into a snag. …

java java-8 jodatime duration java-time
Java: Unable to obtain LocalDate from TemporalAccessor

I am trying to change the format of a String date from EEEE MMMM d to MM/d/yyyy by, …

java java-time date-parsing localdate
Round minutes to ceiling using Java 8

So I'm lucky enough to use Java 8 and the new time APi but I don't see any rounding functions... Basically …

datetime java-8 rounding java-time ceil