D
D
DDwrt1002019-08-15 10:48:06
Java
DDwrt100, 2019-08-15 10:48:06

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 question

Ask a Question

731 491 924 answers to any question