Answer the question
In order to leave comments, you need to log in
How to get seconds from LocalDateTime?
Good afternoon, how can I convert a variable into seconds of int or long format?
Basically I need to take two timestamps subtract and get elapsed time in seconds.
UPD. The question is closed.
decision
ZoneOffset offest = ZoneOffset.UTC;
Long endSessionSeconds = endSession.toEpochSecond(offest);
Long startSessionSeconds = startSession.toEpochSecond(offest);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question