stored-timestamp-is-a-local-wall-clock
Installation
SKILL.md
The column holds a wall clock, not an instant
Two halves, each defensible on its own, written months apart. The producer captures the device's wall clock:
// adapted
fun now(): LocalDateTime = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault())
The ORM's converter then encodes that wall clock as if it were UTC, and decodes it the same way:
// adapted — an exact inverse of itself
@TypeConverter fun dateToTimestamp(date: LocalDateTime?): Long? =
date?.toInstant(TimeZone.UTC)?.toEpochMilliseconds()