Issue Converting seconds to HH:MM:SS java

I have a long variable which represents the downtime of an application in seconds. I want to display the downtime as HH:mm:ss Long downTime = 755; Date newD = new Date(downTime * 1000); When …

Convert java.util.Date to java.time.LocalDate

What is the best way to convert a java.util.Date object to the new JDK 8/JSR-310 java.time.LocalDate? Date input = new Date(); LocalDate date = ???

Wrong time calculated in minutes from two Date objects to calculate duration

I am trying to calculate the duration between two date objects in minutes. I have found some inspiration during my research from this stackoverflow question. In generally this seems to work correct, …

How to get the current date and time

How do I get the current date and time in Java? I am looking for something that is equivalent to DateTime.Now from C#.