import java.time.LocalDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter

private val DTF_LOCAL = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS")

fun main() {
     val now = LocalDateTime.now()
     val ts = now.toInstant(ZoneOffset.UTC).toEpochMilli() / 1000
     println("${now.format(DTF_LOCAL)} / ${ts}")
     # Output:
}