Check out example codes for "java convert LocalDateTime to long". It will help you in understanding the concepts better.

Code Example 1

public long createTimestamp() {
        ZoneId zoneId = ZoneId.systemDefault();
        return LocalDateTime.now().atZone(zoneId).toEpochSecond();
    }

Learn ReactJs, React Native from akashmittal.com