SyntaxFix
Write A Post
Hire A Developer
Questions
This is one way without using time a zone:
LocalDateTime now = LocalDateTime.now(); long epoch = (now.getLong(ChronoField.EPOCH_DAY) * 86400000) + now.getLong(ChronoField.MILLI_OF_DAY);