I want to get the current timestamp like that : 1320917972
int time = (int) (System.currentTimeMillis()); Timestamp tsTemp = new Timestamp(t
Solution in Kotlin:
val nowInEpoch = Instant.now().epochSecond
Make sure your minimum SDK version is 26.