How can I initialize an instant type?
I tried this:
Instant instant = new Instant();
But doesn't work..
I need it because after on Freemarker I have to do this:
[#assign dateFormated = newDate.from(instant.ofEpochSecond(data.time.seconds))/]
How can I initialize an instant type?
I tried this:
Instant instant = new Instant();
But doesn't work..
I need it because after on Freemarker I have to do this:
[#assign dateFormated = newDate.from(instant.ofEpochSecond(data.time.seconds))/]
Straight from the Oracle tutorial:
import java.time.Instant;
Instant timestamp = Instant.now()
You will find other explanations there as well.
Thus the real answer is: by doing some research. Especially the standard library classes come with extensive amounts of Javadoc explaining all of their aspects and most often, there are plenty of tutorials out there, too.