Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun getDeviceStartOfCurrentDay(): Long {
- val zoneId = ZoneId.systemDefault()
- val midnight = LocalTime.MIN
- val today: LocalDate = LocalDate.now(zoneId)
- val todayMidnight: LocalDateTime = LocalDateTime.of(today, midnight)
- val zdt = todayMidnight.atZone(zoneId)
- return zdt.toEpochSecond() * 1000
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement