Realm Date Storage vs. Local UI Timezone Conversion: Need for Explicit Timezone Persistence?
26.5K reputation · 17 Feb 2023, 10:08 UTC
Realm Date Persistence and UI Timezone Display
The goal is to decide whether Realm should persist an explicit timezone identifier together with the UTC instant so that applications can reconstruct the original local time without performing manual conversion on read.
Constraints include maintaining backward compatibility with existing Realms, keeping storage overhead minimal, and ensuring that synchronized Realms continue to converge on the same instant across devices with different zone settings.
Uncertainty remains about the impact on query indexes, migration complexity, and whether the identifier should be optional or required for new schemas.
What are the migration implications for adding a timezone field to existing synchronized Realms? How would query performance be affected if timezone metadata is stored alongside the UTC timestamp? Should the timezone identifier be optional, and how should Realm treat legacy values that lack this field?