I know about such method:
System.currentTimeMillis() / 1000
which return seconds since epoch. BUT it depends on time on device. Maybe smb know about getting timestamp without connection with device time? For example when I change time at device/emulator the total number of seconds since epoch changes too, and logic of my program crashes.