java 8 date with milliseconds code example
Example: java convert LocalDateTime to long
public long createTimestamp() {
ZoneId zoneId = ZoneId.systemDefault();
return LocalDateTime.now().atZone(zoneId).toEpochSecond();
}
public long createTimestamp() {
ZoneId zoneId = ZoneId.systemDefault();
return LocalDateTime.now().atZone(zoneId).toEpochSecond();
}